我在visual basic 中添加了 command 控件 ,但是总是提示Private Sub Command1_Click()变量未定义。
这个是我的程序OptionExplicitPrivateSubCommand1_Click()DimaAsInteger,bAsIntegera=Val(InputBox...
这个是我的程序
Option Explicit
Private Sub Command1_Click()
Dim a As Integer, b As Integer
a = Val(InputBox("请输入x", "输入"))
If a >= 0 Then b = MsgBox(msg, 0, X = asqr(X) = b)
If a < 0 Then b = MsgBox(msg, 48, "输入数据错误:负数不能开平方")
End Sub 展开
Option Explicit
Private Sub Command1_Click()
Dim a As Integer, b As Integer
a = Val(InputBox("请输入x", "输入"))
If a >= 0 Then b = MsgBox(msg, 0, X = asqr(X) = b)
If a < 0 Then b = MsgBox(msg, 48, "输入数据错误:负数不能开平方")
End Sub 展开
1个回答
展开全部
Option Explicit
Private Sub Command1_Click()
Dim a As Integer, b As Integer
a = Val(InputBox("请输入x", "输入"))
If a >= 0 Then b = MsgBox("X = "&Cstr(asqr(X))&" = b")
If a < 0 Then b = MsgBox("输入数据错误:负数不能开平方", 48 )
End Sub
你没定义msg啊
追问
不行
我试过了
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询