主题:inputbox函数显示对话框
Function retnum()
NL = Chr$(13) + Chr$(10)
msg$ = "1.运行DOS命令" + NL + "2.运行VB应用程序"
msg$ = msg$ = NL + "3.计算器"
msg$ = msg$ = NL + NL + "请输入数字选择:"
retnum = InputBox(msg$)
End Function
Private Sub Command1_Click()
r = retnum()
If r = 1 Then
x = Shell("command.com", 1)
ElseIf r = 2 Then
y = Shell("D:\VB精简版\vb6.exe", 1)
ElseIf r = 3 Then
z = Shell("calc.exe", 1)
Else
MsgBox "请输入1-3的数"
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
End Sub
可对话框的提示语为false,程序可照常运行,可输入数字
NL = Chr$(13) + Chr$(10)
msg$ = "1.运行DOS命令" + NL + "2.运行VB应用程序"
msg$ = msg$ = NL + "3.计算器"
msg$ = msg$ = NL + NL + "请输入数字选择:"
retnum = InputBox(msg$)
End Function
Private Sub Command1_Click()
r = retnum()
If r = 1 Then
x = Shell("command.com", 1)
ElseIf r = 2 Then
y = Shell("D:\VB精简版\vb6.exe", 1)
ElseIf r = 3 Then
z = Shell("calc.exe", 1)
Else
MsgBox "请输入1-3的数"
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
End Sub
可对话框的提示语为false,程序可照常运行,可输入数字