设置Combo1下拉时显示的数目
我想设置Combo1下拉时,显示10个数据项,如何设置!
[解决办法]
'设置 Combo 下拉的高度
'单位为 pixels
Public Sub SetComboHeight(oComboBox As ComboBox, lNewHeight As Long)
Dim oldscalemode As Integer
If TypeOf oComboBox.Parent Is Frame Then Exit Sub
oldscalemode = oComboBox.Parent.ScaleMode
oComboBox.Parent.ScaleMode = vbPixels
MoveWindow oComboBox.hwnd, oComboBox.Left, oComboBox.Top, oComboBox.Width, lNewHeight, 1
oComboBox.Parent.ScaleMode = oldscalemode
End Sub
Private Sub Form_Load()
isDo = True
Combo1.AddItem "FDSAF "
Combo1.AddItem "FDSAF "
Combo1.AddItem "FDSAF "
Combo1.AddItem "FDSAF "
Combo1.AddItem "FDSAF "
Combo1.AddItem "FDSAF "
Combo1.AddItem "FDSAF "
Combo1.AddItem "FDSAF "
Combo1.AddItem "FDSAF "
Combo1.AddItem "FDSAF "
Combo1.AddItem "FDSAF "
Combo1.AddItem "FDSAF "
Combo1.AddItem "FDSAF "
Combo1.AddItem "FDSAF "
Combo1.AddItem "FDSAF "
Combo1.AddItem "FDSAF "
Combo1.AddItem "FDSAF "
Combo1.AddItem "FDSAF "
Combo1.AddItem "FDSAF "
Combo1.AddItem "FDSAF "
End Sub
Private Sub Command1_Click() '改变combo1下拉的高度
Call SetComboHeight(Combo1, 250)
End Sub