Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set ComboBox dropped width 1

Status
Not open for further replies.

MikeCox

Programmer
Jun 4, 2001
340
US
Hi!

I need to set the list portion of a combobox to wider than the control itsself. My book tells me the API SendMessage can widen the list portion of a combo box with a call like this:

------------------------------------
SendMessage Combo1.hWnd, CB_SETDROPPEDWIDTH, 300, 0
------------------------------------

The problem is my API viewer cannot find the constant CB_SETDROPPEDWIDTH, and scrolling through the CB_ series constants available (win32api.txt, apiload.txt, and mapi32.txt), I can't find anything that remotely looks like what I need. I really don't want to move a listbox in place if I don't have to. Does anyone know how I can declare CB_SETDROPPEDWIDTH to make this happen? Or is there another API now that I need to use?

Thank you!

-Mike
Any man willing to sacrifice liberty for security deserves neither liberty nor security.

-Ben Franklin
 
WinUser.h has this:
[tt]
#define CB_GETDROPPEDWIDTH 0x015f
#define CB_SETDROPPEDWIDTH 0x0160
[/tt]
Which translates into VB as:
[tt]
Private Const CB_GETDROPPEDWIDTH = &h15f
Private Const CB_SETDROPPEDWIDTH = &h160
[/tt]

Hope this helps.
Chip H.

 
Sweet, works as expected! Thanks a million! Any man willing to sacrifice liberty for security deserves neither liberty nor security.

-Ben Franklin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top