📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "下拉列表框"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "关闭"
Height = 495
Left = 3240
TabIndex = 5
Top = 1320
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "增加"
Height = 495
Left = 1800
TabIndex = 4
Top = 1320
Width = 1215
End
Begin VB.TextBox Text1
Height = 375
Left = 240
TabIndex = 3
Text = "北京"
Top = 1320
Width = 1455
End
Begin VB.CommandButton Command2
Caption = "删除"
Height = 495
Left = 3360
TabIndex = 2
Top = 240
Width = 1215
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1440
TabIndex = 1
Text = "Combo1"
Top = 360
Width = 1215
End
Begin VB.Label Label1
Caption = "城市"
Height = 375
Left = 240
TabIndex = 0
Top = 360
Width = 855
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()
'增加选项
Combo1.AddItem Text1.Text
End Sub
Private Sub Command2_Click()
On Error Resume Next
Dim selecttext As Integer '选择的选项的行数
selecttext = Combo1.ListIndex
'删除选项
Combo1.RemoveItem selecttext
End Sub
Private Sub Command3_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -