Determining if .NET CF ComboBox is Dropped Down

by adam 23. October 2009 15:44

The following snippet of code can be used to determine whether a Windows Mobile ComboBox is currently dropped down or not:

using Microsoft.WindowsCE.Forms;

...

private const int CB_GETDROPPEDSTATE = 0x0157;

private bool IsComboBoxDroppedDown(ComboBox comboBox)
{
    Message comboBoxMessage = Message.Create(comboBox.Handle, CB_GETDROPPEDSTATE, 
         IntPtr.Zero, IntPtr.Zero);
    MessageWindow.SendMessage(ref comboBoxMessage);

    return (comboBoxMessage.Result != IntPtr.Zero);
}


kick it on DotNetKicks.com

Tags: ,

.NET | C#

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About Adam

Adam Plocher

Adam Plocher is a professional Software Engineer in the Sacramento area. He specializes in Microsoft and .NET based development technologies.

Twitter: Adam Plocher LinkedIn: Adam Plocher