# Re: 请问怎样可以令combo自动拉下?(无内文)

Posted by 纪文和 on July 27, 1999 at 12:30:52:

In Reply to: 请问怎样可以令combo自动拉下?(无内文) posted by kkcheung on July 27, 1999 at 11:05:00:

(这个问题不错, 我可以加到我网站资料中)
以下状况假设我在 Form_Load 中自动下拉 combo1.

'以下宣告用于16位元
Const WM_USER = &H400
Const CB_SHOWDROPDOWN = (WM_USER + 15)
Private Declare Function SendMessage Lib "User" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long

'以下宣告用于32位元
Const CB_SHOWDROPDOWN = &H14F
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Private Sub Form_Load()
Combo1.AddItem "11111"
Combo1.AddItem "22222"
Combo1.AddItem "33333"
Combo1.AddItem "44444"
Combo1.AddItem "55555"
Combo1.AddItem "66666"
'Form_Load 即自动下拉 combo1
Dim nret As Long
nret = SendMessage(Combo1.hwnd, CB_SHOWDROPDOWN, 1, ByVal 0&)
End Sub
以上的程式, 我测试过了, 16/32 都没问题 !!

对了, 您问我我网站的 LOGO 小动画图是如何做的, 其实我是做苦功的, 我没什么制图软体, 就用友立公司 (我的室友是友立公司的) 的 PhotoImpact 去做出几张图, 再用 FrontPage98 附的 Microsoft ImageComposer 中的 Microsoft Gif Animator 去将图合并起来. 不过若希望档案不要太大, 则原始的几个小图档就要尽量减小一点.

- VB入门网

Follow Ups:

- 对不起,出现一个问题. kkcheung 15:51:03 7/27/99 (2)
  - Re: 对不起,出现一个问题. 纪文和 17:44:44 7/27/99 (1)
    - 我是用vb6/32.... kkcheung 18:53:59 7/27/99 (0)
- 谢谢你的回覆!...... kkcheung 14:01:10 7/27/99 (0)