Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub cmdcalculate_Click()
- Dim x As Single
- Dim a As Single, b As Single, c As Single
- a = Val(txta.Text)
- b = Val(txtb.Text)
- c = Val(txtc.Text)
- If a + b > c And b + c > a And a + c > b Then
- lblis.Visible = True
- Else
- lblisnot.Visible = True
- End If
- If a ^ 2 + b ^ 2 > c ^ 2 Or a ^ 2 + c ^ 2 > b ^ 2 Or b ^ 2 + c ^ 2 > a ^ 2 Then
- lblacute.Visible = True
- lblright.Visible = False
- lblobtuse.Visible = False
- Else
- lblacute.Visible = False
- End If
- If a ^ 2 + b ^ 2 = c ^ 2 Or a ^ 2 + c ^ 2 = b ^ 2 Or b ^ 2 + c ^ 2 = a ^ 2 Then
- lblright.Visible = True
- lblacute.Visible = False
- lblobtuse.Visible = False
- Else
- lblright.Visible = False
- End If
- If a ^ 2 + b ^ 2 < c ^ 2 Or a ^ 2 + c ^ 2 < b ^ 2 Or b ^ 2 + c ^ 2 < a ^ 2 Then
- lblobtuse.Visible = True
- lblacute.Visible = False
- lblright.Visible = False
- Else
- lblobtuse.Visible = False
- End If
- If a = b And a = c And b = c Then
- lblequ.Visible = True
- lbliso.Visible = False
- lblscal.Visible = False
- ElseIf a = b And a <> c And b <> c Or a = c And a <> b And b <> c Or b = c And b <> a And c <> a Then
- lbliso.Visible = True
- lblscal.Visible = False
- lblequ.Visible = False
- ElseIf a <> b <> c Then
- lblscal.Visible = True
- lblequ.Visible = False
- lbliso.Visible = False
- End If
- Dim angAr As Double
- Dim angAd As Double
- x = (b ^ 2 + c ^ 2 - a ^ 2) / (2 * b * c)
- angAr = Atn(-x / Sqr(-x * x + 1)) + 2 * Atn(1)
- angAd = ((angAr / 3.14159265358979) * 180)
- lblaa.Caption = angAd
- Dim angBr As Double
- Dim angBd As Double
- x = (a ^ 2 + c ^ 2 - b ^ 2) / (2 * a * c)
- angBr = Atn(-x / Sqr(-x * x + 1)) + 2 * Atn(1)
- angBd = ((angBr / 3.14159265358979) * 180)
- lblab.Caption = angBd
- Dim angCr As Double
- Dim angCd As Double
- x = (a ^ 2 + b ^ 2 - c ^ 2) / (2 * a * b)
- angCr = Atn(-x / Sqr(-x * x + 1)) + 2 * Atn(1)
- angCd = ((angCr / 3.14159265358979) * 180)
- lblac.Caption = angCd
- Dim perm As Single
- perm = (txta * 1) + (txtb * 1) + (txtc * 1)
- lblperm.Caption = perm
- cmdarea.SetFocus
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement