Accesing WinCE ComboBox DroppedDown property (.NET CF 2.0)

Posted by PabloG on Stack Overflow See other posts from Stack Overflow or by PabloG
Published on 2010-05-18T00:13:07Z Indexed on 2010/05/18 0:50 UTC
Read the original article Hit count: 317

Filed under:
|
|

I'm implementing custom behavior sub-classing the form controls, but I cannot manage to access the DroppedDown property of the ComboBox. Looking in the help, it's supposed to 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);

...

fails with 'System.Windows.Forms.ComboBox' does not contain a definition for 'DroppedDown' and no extension method 'DroppedDown' accepting a first argument of type 'System.Windows.Forms.ComboBox' could be found

How can I access the property?

TIA, Pablo

© Stack Overflow or respective owner

Related posts about wince

Related posts about windows-mobile