PDA

Click to See Complete Forum and Search --> : How to Increase the width of the Pull-Down bar of the Combo Box


nitinpost
Apr 29th, 2001, 02:44 PM
How to Increase the width of the Pull-Down bar (The portion of the Combo box, on clicking brings the pull down listings)

Tygur
Apr 29th, 2001, 11:30 PM
Do you want to increase the width of the list that drops down or the button you click to show them?

If you want to increase the width of the list that drops down, you can use this code:

'Put this above the rest of the code in the form (in the General Declarations area)
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 Const CB_SETDROPPEDWIDTH = &H160

'Then use this line to change the width of the list that drops down. You can change NewWidthInPixels to be whatever you want the width to be, in pixels.
SendMessage Combo1.hWnd, CB_SETDROPPEDWIDTH, NewWidthInPixels, 0&

Nucleus
Apr 30th, 2001, 12:22 AM
Hey Tygur,

Do you know how to change the icon displayed in the combox box, I mean the little arrow you click on, to a custom ico file?

Tygur
Apr 30th, 2001, 02:21 PM
Unfortunately, I couldn't find any information in the MSDN library about changing the size of the button in the combobox or putting an icon on it. I'll look again later, though.

Nucleus
Apr 30th, 2001, 04:59 PM
Thanks Tygur