c#.net中继承的文本框和组合框 [英] inherited textbox and combobox in c#.net
本文介绍了c#.net中继承的文本框和组合框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在自定义textbox和comboBox,我希望这两个类(TextBox和ComboBox)都是这样的。
i am customizing textbox and comboBox and i want to inhere both classes (TextBox and ComboBox) like this.
public class TextBoxUrdu:System.Windows.Forms.TextBox,ComboBox
public class TextBoxUrdu : System.Windows.Forms.TextBox, ComboBox
但它显示"Class TextBoxUrdu  不能有多个基类:'TextBox'和'ComboBox'"
but it show "Class TextBoxUrdu cannot hvae multiple base classes: 'TextBox' and 'ComboBox' "
请帮助我。
推荐答案
考虑用户控制:
- https://msdn.microsoft.com/ library / 00ctb4z0(v = vs.110)
- https://msdn.microsoft.com/en-us/library/system.windows.forms.usercontrol(v = vs.110).aspx
即使用Visual Studio的"新建项目"功能创建新的"用户控件",然后放置文本框和组合框。编译后,在设计表单时,新控件将显示在工具箱中。
这篇关于c#.net中继承的文本框和组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文