ComboBox

  • Thread starter Charles A. Lackman
  • Start date
C

Charles A. Lackman

Hello,

I have a combox that is being filled from a dataset. The combobox is
located on a Tabcontrol. On the e.keycode = keys.Enter event I have
TabControl moving to another Tab. When this happens the combobox is in the
foreground of the new tab in an open state, ie, showing all 8 drop down
items.

Is there a way to make the combobox close on the keys.Enter Event?

I have tried to make the combobox visible = false on the Enter and the
combobox does become invisible, but the stupid drop down items are still
visible. Weird huh?

Thanks,

Chuck
 
A

Adrian

Using SendMessage as below:

[System.Runtime.InteropServices.DllImport("User32.dll")]

public extern static void SendMessage(IntPtr hwnd, uint message, int wparam,
int lparam);

int CB_SHOWDROPDOWN = 0x014F;

int show = 1;

int hide = 0;

For showing listbox, use 1. For hiding it, use 0.

SendMessage(comboBox1.Handle, CB_SHOWDROPDOWN, /*show or hide*/ , 0);

Hope that helps.
 
C

Charles A. Lackman

Thanks,

How is this implemented in VB.NET??

Thanks,

Chuck


Using SendMessage as below:

[System.Runtime.InteropServices.DllImport("User32.dll")]

public extern static void SendMessage(IntPtr hwnd, uint message, int wparam,
int lparam);

int CB_SHOWDROPDOWN = 0x014F;

int show = 1;

int hide = 0;

For showing listbox, use 1. For hiding it, use 0.

SendMessage(comboBox1.Handle, CB_SHOWDROPDOWN, /*show or hide*/ , 0);

Hope that helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top