Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

Extended user interface for combo boxes

Total Hit ( 2951)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


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:

Click here to copy the following block
Const CB_SETEXTENDEDUI = &H155
Const CB_GETEXTENDEDUI = &H156

Declare 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, False

Function SetComboExtendedUIMode(ComboCtl As ComboBox, ByVal bState As Boolean)
  SendMessage ComboCtl.hwnd, CB_SETEXTENDEDUI, Abs(bState), ByVal 0
End Function


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.