Available WinCE ComboBox DroppedDown Property (.NET CF 2.0)

I implement custom behavior by subclassing form controls, but I am unable to access the DroppedDown property for ComboBox. Looking for help, it should be supported in CF.NET 2.0:

using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Text; using System.Windows.Forms; namespace xCustomControls { public partial class xComboBox : System.Windows.Forms.ComboBox { private ComboBox comboBox1; public xComboBox() { InitializeComponent(); this.KeyDown += new KeyEventHandler(this.KeyDownHandler); } private void KeyDownHandler(object sender, KeyEventArgs e) { // DroppedDown doesn't appear in the IntelliSense of ComboBox. // or this.comboBox1. if (((ComboBox)sender).DroppedDown) // fail! return; switch (e.KeyData) { case Keys.Up: case Keys.Enter: case Keys.Down: e.Handled = true; this.Parent.SelectNextControl((Control)sender, e.KeyData != Keys.Up, true, true, true); ... 

the failure of "System.Windows.Forms.ComboBox" does not contain a definition for "DroppedDown", and the extension method "DroppedDown", which takes the first argument of the type "System.Windows.Forms.ComboBox", can be found

How can I access the property?

TIA, Pablo

+2
source share
1 answer

The DroppedDown property DroppedDown not in a compact structure, but you can use something like this:

 public const int CB_GETDROPPEDSTATE = 0x0157; public static bool GetDroppedDown(ComboBox comboBox) { Message comboBoxDroppedMsg = Message.Create(comboBox.Handle, CB_GETDROPPEDSTATE, IntPtr.Zero, IntPtr.Zero); MessageWindow.SendMessage(ref comboBoxDroppedMsg); return comboBoxDroppedMsg.Result != IntPtr.Zero; } 

Taken from: http://msdn.microsoft.com/en-us/netframework/bb735847.aspx

+1
source

Source: https://habr.com/ru/post/1469482/


All Articles