VB编程,如何实行点击组合框下拉键例出十多行的选项

老师请指教.... 老师请指教. 展开
 我来答
堵义80
2006-07-20 · TA获得超过174个赞
知道小有建树答主
回答量:241
采纳率:0%
帮助的人:178万
展开全部
你是不是嫌下拉框的长度不够使的?要是这样一来的话可以使用如下代码:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
'本函数是用于设置combox下拉列表框的长度的.
Private Sub SetComboHeight(oComboBox As ComboBox, lNewHeight As Long)
Dim oldscalemode As Integer
'注释: This procedure does not work with frames: you
'注释: cannot set the ScaleMode to vbPixels, because
'注释: the frame does not have a ScaleMode Property.
'注释: To get round this, you could set the parent control
'注释: to be the form while you run this procedure.
If TypeOf oComboBox.Parent Is Frame Then Exit Sub
'注释: Change the ScaleMode on the parent to Pixels.
oldscalemode = oComboBox.Parent.ScaleMode
oComboBox.Parent.ScaleMode = vbPixels
'注释: Resize the combo box window.
MoveWindow oComboBox.hwnd, oComboBox.Left, oComboBox.Top, oComboBox.Width, lNewHeight, 1
'注释: Replace the old ScaleMode
oComboBox.Parent.ScaleMode = oldscalemode
End Sub
在窗体的LOAD中可添加Call SetComboHeight(Combo1, 270) '设置combo的下拉长度.
来调用.
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
zheng0823
2006-07-20 · TA获得超过975个赞
知道小有建树答主
回答量:1117
采纳率:0%
帮助的人:994万
展开全部
在属性中设置啊,有个list,看到了吗??
通过它就可以设置的!!
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式