我应该通过在我的 WinForms 应用程序中从 ComboBox 派生一个类来创建一个自定义 ComboBox。我以前从未这样做过,也无法从谷歌找到很多好的例子。
我需要派生一个自定义组合框,以便我可以将自定义组合框类型绑定到特定对象。
你能指出我正确的方向吗?
这就是我到目前为止所拥有的。
自定义组合框.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace MAPClient {
class MAPCodeComboBox : ComboBox {
}
}
我有一些具体的问题:
- 我需要重写哪些方法?
- 如何在我的 VS2010 设计器模式下使用它?