How to drop down a combo box (CF2.0) programatically?

D

Dirk Michaelsen

Hello everybody,

is there a way to drop down a combo box from the Compact Framework 2.0
programatically, especially in C# language? In the .NET framework the
combo box has the DroppedDown property but unfortunately in .NET CF it
has not.

I would appreciate hints and code samples.

Dirk
 
D

dbgrick

Dirk,
All you have to do is send the CB_SHOWDORPDOWN message to the combo box.
Here is some sample code:

private const uint CB_SHOWDROPDOWN = 0x014f;
private const int TRUE = 1;
private const int FALSE = 0;

[DllImport("Coredll.dll", EntryPoint="SendMessage", SetLastError = true)]
private static extern int SendMessage(IntPtr hWnd, uint msg, int wParam, int
lParam);

private void button1_Click_1(object sender, EventArgs e)
{
SendMessage(this.comboBox1.Handle, CB_SHOWDROPDOWN, TRUE, 0);
}

Regard,
Rick D.
Contractor
 

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