📄 例[6-16].frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "例[6-16] 组合框的应用 "
ClientHeight = 2445
ClientLeft = 60
ClientTop = 345
ClientWidth = 3495
LinkTopic = "Form1"
ScaleHeight = 2445
ScaleWidth = 3495
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "统计"
Height = 375
Left = 2520
TabIndex = 6
Top = 1560
Width = 855
End
Begin VB.CommandButton Command2
Caption = "删除"
Height = 375
Left = 2520
TabIndex = 5
Top = 960
Width = 855
End
Begin VB.CommandButton Command1
Caption = "添加"
Height = 375
Left = 2520
TabIndex = 4
Top = 360
Width = 855
End
Begin VB.ComboBox Combo2
Height = 300
ItemData = "例[6-16].frx":0000
Left = 840
List = "例[6-16].frx":0002
TabIndex = 3
Top = 1560
Width = 1335
End
Begin VB.ComboBox Combo1
Height = 900
ItemData = "例[6-16].frx":0004
Left = 840
List = "例[6-16].frx":0006
Style = 1 'Simple Combo
TabIndex = 2
Top = 360
Width = 1335
End
Begin VB.Label Label2
Caption = "籍贯:"
Height = 255
Left = 120
TabIndex = 1
Top = 1560
Width = 975
End
Begin VB.Label Label1
Caption = "姓名:"
Height = 375
Left = 120
TabIndex = 0
Top = 480
Width = 1095
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()
If Combo1.Text <> "" And Combo2.Text <> "" Then ' 如果输入内容不为空,则添加数据项
Combo1.AddItem Combo1.Text
Combo2.AddItem Combo2.Text
End If
End Sub
Private Sub Combo1_Click()
Combo2.ListIndex = Combo1.ListIndex
End Sub
Private Sub Command2_Click()
Index1 = Combo1.ListIndex
Combo1.RemoveItem Index1 '删除所选数据项
Combo2.RemoveItem Index1
End Sub
Private Sub Command3_Click()
Print Combo1.ListCount
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -