Combobox question ...

  • Thread starter Thread starter JustMe
  • Start date Start date
J

JustMe

Hello.

Is there anyway to force a combobox list to 'open'? In other words, I don't
want the user to have to manually tap the arrow to see the list ... I want
to do it from code.

Your help is appreciated.
-Terry
 
Just send a F4 key to a Combobox. Something like that:

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

private void OpenCombo(ComboBox ctl)
{
ctl.Focus();
keybd_event((byte)Keys.F4, 0, 0, 0);
}

======================================
 
Thanks Alex! That helped immensely.

-Terry

Alex Yakhnin said:
Just send a F4 key to a Combobox. Something like that:

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

private void OpenCombo(ComboBox ctl)
{
ctl.Focus();
keybd_event((byte)Keys.F4, 0, 0, 0);
}

======================================

--
Alex Yakhnin
IntelliProg, Inc.
http://www.intelliprog.com

-----Original Message-----
Hello.

Is there anyway to force a combobox list to 'open'? In other words, I don't
want the user to have to manually tap the arrow to see the list ... I want
to do it from code.

Your help is appreciated.
-Terry


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/2003


.
 
Another question, how would you know an incoming object is a combobox?

I.e. I want to open the combobox if it's focused but if a textbox is
selected I don't want to...

/ P

JustMe said:
Thanks Alex! That helped immensely.

-Terry

Alex Yakhnin said:
Just send a F4 key to a Combobox. Something like that:

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

private void OpenCombo(ComboBox ctl)
{
ctl.Focus();
keybd_event((byte)Keys.F4, 0, 0, 0);
}

======================================

--
Alex Yakhnin
IntelliProg, Inc.
http://www.intelliprog.com

-----Original Message-----
Hello.

Is there anyway to force a combobox list to 'open'? In other words, I don't
want the user to have to manually tap the arrow to see the list ... I want
to do it from code.

Your help is appreciated.
-Terry


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/2003


.
 
Back
Top