Re: combo box dropdown via code? by Paul
Paul
Sat Nov 26 12:16:04 CST 2005
Peter,
Thanks for the help. I tried the following code it didnt work. Are you sure
its F4? Does the kb_event line look right?
Thanks.
private const byte VK_F4 = 0x73;
[DllImport("coredll.dll")]
private static extern void keybd_event(byte bVk, byte bScan, uint
dwFlags, uint dwExtraInfo);
protected void ExpandDropDown(ComboBox cb)
{
cb.Focus();
System.Windows.Forms.Application.DoEvents();
keybd_event(VK_F4, 0, KEYEVENTF_KEYDOWN, 0);
}
Thanks Again!!!
"Peter Foot [MVP]" <feedback@nospam-inthehand.com> wrote in message
news:%23qGkOIF8FHA.1416@TK2MSFTNGP09.phx.gbl...
> You can programmatically send the control an F4 keypress (once the control
> has focus) which will drop the list. OpenNETCF.Windows.Forms.SendKeys has
> functionality to do this - www.opennetcf.org/sdf/
>
> Peter
>
> --
> Peter Foot
> Windows Embedded MVP
> www.peterfoot.net | www.inthehand.com
>
> "Paul" <jpierce2@austin.rr.com> wrote in message
> news:uF94C4E8FHA.740@TK2MSFTNGP11.phx.gbl...
>> Is there a way to get a dropdown combo box to expand via code? I tried
>> setting focus but that didnt work.
>>
>> Thanks
>>
>
>