📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "改变下拉列表框的宽度"
ClientHeight = 2730
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 2730
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "退出"
Height = 495
Left = 1200
TabIndex = 1
Top = 1560
Width = 1215
End
Begin VB.ComboBox Combo1
Height = 300
Left = 600
TabIndex = 0
Text = "Combo1"
Top = 240
Width = 2055
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()
Unload Me
End Sub
Sub Form_Load()
Dim ret As Long
Combo1.AddItem "照猫画虎"
Combo1.AddItem "http://zmhh.mycool.net"
'设定ComboBox宽度为150 Pixel。
setwidth = 150
'记录原本的Window Procedure的位址。
preWinProc = GetWindowLong(Combo1.hwnd, GWL_WNDPROC)
'设定Combo1的window Procedure到wndproc。
ret = SetWindowLong(Combo1.hwnd, GWL_WNDPROC, AddressOf wndproc)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim ret As Long
'取消Message的截取,恢复原来的Window Procedure。
ret = SetWindowLong(Combo1.hwnd, GWL_WNDPROC, preWinProc)
Set Form1 = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -