Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Compact Framework / August 2007

Tip: Looking for answers? Try searching our database.

combobox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Scott Toney - 28 Aug 2007 15:28 GMT
Is there anyway to automagically open/drop down a combobox?

Thanks
Christian Resma Helle - 28 Aug 2007 15:50 GMT
Hi Scott,

Set the Focus to your ComboBox and send the ENTER keyboard event using
keybd_event. Here's some sample code for sending keyboard events

[DllImport("coredll.dll")]
static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int
dwExtraInfo);

const int KEYEVENTF_KEYPRESS = 0x0000;
const int KEYEVENTF_KEYUP = 0x0002;

void SendKey(System.Windows.Forms.Keys key) {
 keybd_event((byte)key, 0, KEYEVENTF_KEYPRESS, 0); // key press
 keybd_event((byte)key, 0, KEYEVENTF_KEYUP, 0); // key release
(KEYEVENTF_KEYUP)
}

Signature

Regards,
Christian Resma Helle
http://christian-helle.blogspot.com

> Is there anyway to automagically open/drop down a combobox?
>
> Thanks
Peter Foot [MVP] - 28 Aug 2007 18:16 GMT
Alternatively you can send a CB_SHOWDROPDOWN message to the control.

Peter

Signature

Peter Foot
Microsoft Device Application Development MVP
www.peterfoot.net | www.inthehand.com
In The Hand Ltd - .NET Solutions for Mobility

> Hi Scott,
>
[quoted text clipped - 17 lines]
>>
>> Thanks

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.