📄 msg.frm
字号:
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 3 'Fixed Dialog
Caption = "VB教程--第七章--范例一"
ClientHeight = 2535
ClientLeft = 3630
ClientTop = 4515
ClientWidth = 4605
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2535
ScaleWidth = 4605
ShowInTaskbar = 0 'False
Begin VB.ComboBox Combo2
Height = 315
Left = 1800
TabIndex = 2
Text = "Combo2"
Top = 120
Width = 1215
End
Begin VB.ComboBox Combo1
Height = 315
Left = 240
TabIndex = 1
Text = "Combo1"
Top = 120
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "Click ME"
Height = 495
Left = 3240
TabIndex = 0
Top = 1920
Width = 1215
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
message = MsgBox("显示" & Combo1.List(Combo1.ListIndex) & "和" & Combo2.List(Combo2.ListIndex), Combo1.ListIndex + (Combo2.ListIndex + 1) * 16, "消息演示")
Select Case message
Case 1
MsgBox "你按下了OK钮"
Case 2
MsgBox "你按下了Cancel按钮"
Case 3
MsgBox "你按下了Abort按钮"
Case 4
MsgBox "你按下了Retry按钮"
Case 5
MsgBox "你按下了Ignore按钮"
Case 6
MsgBox "你按下了Yes按钮"
Case 7
MsgBox "你按下了No按钮"
End Select
End Sub
Private Sub Form_Load()
Combo1.AddItem "OK"
Combo1.AddItem "OK and Cancel"
Combo1.AddItem "Abort,Retry and Ignore"
Combo1.AddItem "Yes,No,Cancel"
Combo1.AddItem "Yes,No"
Combo1.AddItem "Retry,Cancel"
Combo1.ListIndex = 0
Combo2.AddItem "危险"
Combo2.AddItem "询问"
Combo2.AddItem "警告"
Combo2.AddItem "信息"
Combo2.ListIndex = 0
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -