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#

Comments

10/27/2009 5:26:49 PM #

trackback

Determining if .NET CF ComboBox is Dropped Down

You've been kicked (a good thing) - Trackback from DotNetKicks.com

DotNetKicks.com | Reply

10/29/2009 3:57:22 AM #

Alex

Hi, sounds nice, what dll need to invoke to use the Message object ? or where i can find it ?

Alex United States | Reply

10/29/2009 4:32:55 AM #

Alex

Ok i found it. Microsoft.WindowsCE.Forms

Alex United States | Reply

10/29/2009 8:06:43 PM #

adam

Thanks for the feedback Alex, I've updated the post to show the "using" that's required.

adam United States | Reply

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



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


Month List