News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

List box

Started by Klod, October 24, 2005, 03:55:23 AM

Previous topic - Next topic

Klod

I've been searching this forum on information on how to make a dropdown Listbox, but can't seem to find anything.
The styles listed in the  Win32SDK do not contain a dropdown style. the SDK reads:
Quote
To create a list box by using the CreateWindow or CreateWindowEx function, use the LISTBOX class, appropriate window style constants, and the following style constants to define the list box.
Quote
What are "appropriate" window style constants for a Listbox? Using WS_VSCROLL style will add a scrollbar but I can't make it dropdown.
Is this style only for ComboBoxes?
I would like to make the width of the Listbox the same as the length of the strings it displays. How do I convert a string length to dialog units?
any help would be appreciated

Tedd

What you actually want is a "combobox" :wink

So you'll need the following lines:

IDCB equ 1001

.data
cbClass     db "COMBOBOX",0
      .
      .

      .
      .
    .ELSEIF (eax==WM_CREATE)
        invoke CreateWindowEx, WS_EX_CLIENTEDGE,ADDR cbClass,NULL,WS_VISIBLE or WS_CHILD or WS_VSCROLL or CBS_DROPDOWNLIST or CBS_HASSTRINGS or CBS_SORT,5,5,150,200,hwnd,IDCB,hInstance,NULL
      .
      .


Combobox styles all start with CBS_ - which you can find in the windows api help or on msdn, etc (or even search through windows.inc).
No snowflake in an avalanche feels responsible.