當前位置:編程學習大全網 - 電腦編程 - 求VB計算長方形的周長和面積編程

求VB計算長方形的周長和面積編程

妳只需要編程麽?

Private Sub Command1_Click()

If Val(Text1.Text) > 0 And Val(Text2.Text) > 0 Then

Label1.Caption = "長方形的面積為:" & Val(Text1.Text) * Val(Text2.Text)

Label2.Caption = "長方形的周長為:" & 2 * (Val(Text1.Text) + Val(Text2.Text))

Else

MsgBox "您輸入的數據不規範,請重新輸入!", , "提示"

End If

End Sub

  • 上一篇:在貴陽市開辦北大新學堂3D少兒英語班,什麽樣的地點比較適合?場地需要多大?
  • 下一篇:vb當中的i,j不用定義嗎?
  • copyright 2024編程學習大全網