當前位置:編程學習大全網 - 網站源碼 - vb編譯錯誤:必選參數

vb編譯錯誤:必選參數

Private Sub Command1_Click()

Dim a As Double, b As Double, c As Double

Dim s As Double, area As Double, r As Integer

a = Val(Text1)

b = Val(Text2)

c = Val(Text3)

If a + b > c Or a + c > b Or b + c > a Then

s = (a + b + c) / 2

area = Sqr(s * (s - a) * (s - b) * (s - c))

MsgBox "三角形的面積是:" & Str(area), , "計算三角形面積程序"

Else

MsgBox "輸入的三邊不能構成三角形"

End If

End Sub

Private Sub Form_Load()

Text1 = "40"

Text2 = "50"

Text3 = "80"

Command1.Caption = "計算"

End Sub

  • 上一篇:閱流小程序打開zip
  • 下一篇:買賣遊戲指標源代碼
  • copyright 2024編程學習大全網