all groups > dotnet compact framework > december 2007 >
You're in the

dotnet compact framework

group:

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



How to drop down a combo box (CF2.0) programatically? Dirk Michaelsen
12/21/2007 7:11:09 AM
dotnet compact framework: 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
RE: How to drop down a combo box (CF2.0) programatically? dbgrick
12/21/2007 9:11:00 AM
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

[quoted text, click to view]
AddThis Social Bookmark Button