2
我正在實現自定義行爲子分類表單控件,但我無法設法訪問組合框的DroppedDown屬性。在幫助尋找,它應該在CF.NET 2.0支持:訪問WinCE組合框DroppedDown屬性(.NET CF 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);
...
失敗「System.Windows.Forms.ComboBox」不包含「DroppedDown」,沒有擴展方法的定義「DroppedDown」接受類型'System.Windows.Forms.ComboBox'的第一個參數可能被發現
如何訪問該屬性?
TIA, 巴勃羅
就像一個魅力, 謝謝! 明天我會嘗試着明天這麼做,所以今天SO說「我的投票是鎖定的」:( – PabloG 2010-05-18 15:12:37
@PabloG,你好,我沒有。不在緊湊框架中。 – 2010-05-18 20:27:53