VB中IF判断我想做一个这样的I
在判断中插如MSGBOX对话,确认继续:
Option Explicit
Private Sub Command1_Click()
Dim a As Integer
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
a = Val(Text1)
If a = 1 Then
a = a + 1
Msg = "Do you want to continue ?" ' 定义信息。
Style = vbYesNo + vbCritical + vbDefaultButton2 ' 定义按钮。
Title = "MsgBox De...全部
在判断中插如MSGBOX对话,确认继续:
Option Explicit
Private Sub Command1_Click()
Dim a As Integer
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
a = Val(Text1)
If a = 1 Then
a = a + 1
Msg = "Do you want to continue ?" ' 定义信息。
Style = vbYesNo + vbCritical + vbDefaultButton2 ' 定义按钮。
Title = "MsgBox Demonstration" ' 定义标题。
Help = "DEMO。HLP" ' 定义帮助文件。
Ctxt = 1000 ' 定义标题
' 上下文。
' 显示信息。
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then ' 用户按下“是”。
MyString = "Yes" ' 完成某操作。
Else ' 用户按下“否”。
MyString = "No" ' 完成某操作。
End If
End If
If a = 2 Then
Text1 = a
End If
If a = 3 Then
Text1 = a
End If
End Sub。收起