Broad Network


Combo Box Styles

Windows Predefined Controls – Part 22

Volume - Windows User Interface

Forward: In this part of the series, we look at Combo Box Styles.

By: Chrysanthus Date Published: 29 Aug 2012

Introduction

This is part 22 of my series, Windows Predefined Controls. In order to understand this tutorial, you must have read all the previous tutorials of the series. In this part of the series, we look at Combo Box Styles.

Note: If you cannot see the code or if you think anything is missing (broken link, image absent), just contact me at forchatrans@yahoo.com. That is, contact me for the slightest problem you have about what you are reading.

Styles
The appearance and outward behavior of a control is determined by its styles. These styles include the WS_CHILD. Styles can be combined with the | operator as value for the dwStyle argument of the CreateWindowEx function. | means and/or at that position. The items you type as the dwStyle value are identifiers of constants. I now give you the style constants and their meanings.

Constant: Meaning
CBS_AUTOHSCROLL: This style automatically scrolls the text in an edit control to the right when the user types a character at the end of the line. If this style is not set, only text that fits within the rectangular boundary is allowed.

CBS_DISABLENOSCROLL: This style shows a disabled vertical scroll bar in the list box when the box does not contain enough items to scroll. Without this style, the scroll bar is hidden when the list box does not contain enough items.

CBS_DROPDOWN: This style is used to create a drop down combo box.

CBS_DROPDOWNLIST: This style is used to create a drop down list combo box.

CBS_LOWERCASE: This style converts to lowercase all text in both the selection field and the list.

CBS_NOINTEGRALHEIGHT: Normally, the system sizes a combo box so that it does not display partial items. This style specifies that the size of the combo box is exactly the size specified by the application when it created the combo box.

CBS_OEMCONVERT: This style converts text entered in the combo box edit control from the Windows character set to the OEM character set (see later) and then back to the Windows character set. This ensures proper character conversion when the application calls the CharToOem function (see later) to convert a Windows string in the combo box to OEM characters. This style is most useful for combo boxes that contain file names and applies only to combo boxes created with the CBS_SIMPLE or CBS_DROPDOWN style.

CBS_SIMPLE: This style is used to create a simple combo box.

CBS_SORT: This style automatically sorts strings added to the list box.

CBS_UPPERCASE: This style converts to uppercase all text in both the selection field and the list.

That is it for this part of the series. We stop here and continue in the next part.

Chrys

Related Courses

C++ Course
Relational Database and Sybase
Windows User Interface
Computer Programmer – A Jack of all Trade – Poem
NEXT

Comments

Become the Writer's Fan
Send the Writer a Message