HeaderPane
Main
Hide
Share Link
Print

Components

A combo box control is composed of several parts. Which parts are present depends on the combo box style (see Window Styles): a simple combo box has an edit control portion and an always visible item list, a dropdown combo box has an edit control portion, a dropdown button and a dropdown portion, and a dropdown list combo box has a static portion, a dropdown button and a dropdown portion.

Several functions have an fMain parameter, which selects the static portion (TRUE) or the dropdown portion (FALSE). Notifications caused by the static portion are sent using SFTBOXN_MAIN_NOTIFICATION (see Notifications).

Static PortionColumn HeaderSort IndicatorDropdown ButtonRow/Column HeaderRow HeaderLabel PictureExpand/Collapse ButtonTree LinesItem PictureGrid LinesCell TextDropdown PortionCell PictureSizing Box

Portions of the Control

Static portion - The area of a dropdown list combo box which displays the selected item, with its pictures and the cells of all columns. The static portion can have its own column headers (SetShowHeaderMain) and can be aligned with the item in the dropdown portion (SFTBOX_CONTROL, fStaticAligned).

Edit control portion - The edit control of a simple or dropdown combo box, used to enter text or to display the text of the selected item. SetEditSearchColumn defines the column shown and searched, SetEditSearchMode defines how typed text locates an item (including autocompletion), LimitText, SetEditSel, SetEditAlign and SetReadOnly control its contents and appearance. GetHWNDEdit returns the window handle of the edit control.

Dropdown portion - The list of items. In a dropdown or dropdown list combo box it is shown when the dropdown button is clicked (or by using ShowDropDown) and hidden once an item has been selected; in a simple combo box it is always visible. SetDroppedHeight, SetDroppedWidth, SetDropDownOptimalWidth and SetDropDownPosition define its size and position, GetDroppedState returns whether it is currently shown.

Dropdown button - The button used to show and hide the dropdown portion. SetDropDownButtonStyle defines its appearance, SetDropDownButtonPicture and SetDropDownButtonDroppedPicture replace the arrow with a picture. GetDropDownButtonRect returns its location.

Columns and Headers

Columns - A combo box has one or more columns, defined using SetColumns and an array of SFTBOX_COLUMN structures. Each column has a width, text alignment, optional colors and a position, so columns can be displayed in a different order than they are defined (see GetDisplayColumn and GetRealColumn). The user can resize and reorder columns using the column headers (SetResizeHeader, SetReorderColumns).

Column headers - The optional titles above the columns, shown in the dropdown portion (SetShowHeaderDropDown), the static portion (SetShowHeaderMain) or both. Column headers display text (SetHeader) and a picture, can act as buttons (SetHeaderStyle, GetHeaderButton) and can show a sort direction indicator (EnableSortIndicators).

Row headers - An optional area to the left of the items, with a text or a number for each item. SetShowRowHeader and SetRowHeaderStyle define whether and how row headers are shown, SetRowText defines the text of an item's row header, SetRowInfo its colors and picture and SetRowHeaderWidth (or MakeRowHeaderOptimal) the width.

Row/column header - The area where the row headers and the column headers meet. It can display text (SetRowColText, aligned using SetRowColHeaderStyle) and a picture (SetRowColPicture) and can act as a button (SetShowRowColHeaderButton).

Items

Items - The entries of the dropdown portion, added using AddString or InsertString and identified by their zero-based index. An item has a level (SetItemLevel), which defines the hierarchy: an item is a dependent of the closest preceding item with a lower level, its parent item. Items can be expanded and collapsed (Expand, Collapse), disabled (SetItemStatus) and hidden (SetItemShown). A combo box has one selected item (SetCurSel, GetCurSel).

Cells - Each item has one cell for each column. A cell displays text (SetText) and an optional cell picture; colors, font, text and picture alignment of a cell are defined using SetCellInfo and the SFTBOX_CELL structure.

Pictures - An item can display an item picture next to the text of its first column (SetItemPicture, or default pictures for all items using SetPictures) and a label picture (SetItemLabelPicture). Every cell can display a cell picture (SFTBOX_CELL, CellPicture1). Column headers, row headers, the row/column header and the dropdown button can also display a picture. All pictures are described by a SFT_PICTURE structure, which supports bitmaps, icons, image lists, color samples and GDI+ images.

Expand/collapse buttons - The buttons shown next to a parent item, used to show or hide its dependent items. SetShowButtons enables the buttons for items at level 1 and above, SetShowButton0 for items at level 0 and SetButtons selects the button style.

Tree lines - The lines connecting the items of a hierarchy, which show how items relate to each other. SetShowTreeLines shows or hides the tree lines, SetTreeLineStyle defines their style and SetIndentation the indentation of each level.

Grid lines - Optional horizontal and vertical lines separating items and columns (SetShowGrid, SetGridStyle).

Sizing Box

Sizing box - The area in the lower right corner of the dropdown portion of a dropdown or dropdown list combo box, between the vertical and horizontal scroll bars, which the user can drag to resize the dropdown portion. The sizing box is enabled using SetShowResizer and is available if the combo box is created with the WS_VSCROLL and WS_HSCROLL window styles and shows scroll bars that are not needed disabled (SFTBOXSTYLE_DISABLENOSCROLL window style or SetDisableNoScroll). The SFTBOXN_SIZEBOX notification is sent when the dropdown portion has been resized.

See Also Window Styles | Notifications | SFTBOX_COLUMN | SFTBOX_CELL | SFTBOX_CONTROL


Last Updated 11/22/2026 - (email)
© 2026 Softel vdm, Inc.