Extended user interface for combo boxes

Apart from the different kind of combo boxes you can obtain by manipulating the Style property, another feature is made available by Windows when dealing with combo box controls, the so-called extended user interface. With standard combo box controls, the list portion stays invisible until the user presses F4 or the Alt-Down cursor key, or clicks on the arrow button on the right of the field: in such standard combo boxes pressing the Down cursor key results in showing the next available item in the text box, without opening the list. If you think that these key combinations are counter-intuitive for your user, you might enforce the extended user interface, so that the list portion appears as soon as he or she presses the Down key.

The extended user interface is enabled using the CB_SETEXTENDEDUI message; the third argument of the SendMessage function states if we wish to enable or disable this feature. The CB_GETEXTENDEDUI message returns the current status of this feature. Here are two routines that encapsulate the calls to SendMessage:

Const CB_SETEXTENDEDUI = &H155Const CB_GETEXTENDEDUI = &H156Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As _    Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long' retrieve the ExtendedUI mode state' Example:'   MsgBox "ExtendedUI mode is enabled: " & GetComboExtendedUIMode(Combo1)Function GetComboExtendedUIMode(ComboCtl As ComboBox) As Boolean    GetComboExtendedUIMode = SendMessage(ComboCtl.hwnd, CB_GETEXTENDEDUI, 0, _        ByVal 0)End Function' set whether the ExtendedUI mode is enabled' Example: enable the ExntendedUI mode'   SetComboExtendedUIMode Combo1, True' Example: disable the ExntendedUI mode'   SetComboExtendedUIMode Combo1, FalseFunction SetComboExtendedUIMode(ComboCtl As ComboBox, ByVal bState As Boolean)    SendMessage ComboCtl.hwnd, CB_SETEXTENDEDUI, Abs(bState), ByVal 0End Function

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


The Latest

technology leadership

Why the World Needs More Technology Leadership

As a fact, technology has touched every single aspect of our lives. And there are some technology giants in today’s world which have been frequently opined to have a strong influence on recent overall technological influence. Moreover, those tech giants have popular technology leaders leading the companies toward achieving greatness.

iOS app development

The Future of iOS App Development: Trends to Watch

When it launched in 2008, the Apple App Store only had 500 apps available. By the first quarter of 2022, the store had about 2.18 million iOS-exclusive apps. Average monthly app releases for the platform reached 34,000 in the first half of 2022, indicating rapid growth in iOS app development.

microsoft careers

Top Careers at Microsoft

Microsoft has gained its position as one of the top companies in the world, and Microsoft careers are flourishing. This multinational company is efficiently developing popular software and computers with other consumer electronics. It is a dream come true for so many people to acquire a high paid, high-prestige job