VB编程题第1题怎么做,求大神啊
Private Sub Command1_Click()
Dim x As Double
If IsNumeric(Text1.Text) Then
x = Val(Text1.Text)
Text2.Text = x * (-1)
Text3.Text = x * x
Text4.Text = Sqr(Abs(x))
Text5.Text = x * x * x
Text6.Text = (Abs(x)) ^ (1 / 3)
Else
MsgBox ("输入的不是合法数字,请重新输入!")
Text1.SetFocus
Exit Sub
End If
End Sub
Private Sub Form_Load()
Label1.Caption = "请输入数字"
Label2.Caption = "相反数"
Label3.Caption = "平方"
Label4.Caption = "绝对值的平方根"
Label5.Caption = "立方"
Label6.Caption = "绝对值的立方根"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Command1.Caption = "计算"
End Sub
2017-03-18
老铁,我几千分随便给几个100分都行,你要是不知道就别乱答好不
我还真知道。我的财富值十几万。 但你太不会提问题了,推荐阅读《提问的智慧》,搜一下就有。