button按钮的基类是谁呢?如何可以看出来?
我不知如何看?
是 system.windows.controls呢?
还是 system.windows.forms?在对象浏览器中,有下面两个,所以我不明白,button的基类是 controls呢?还是 forms呢?
System.Windows.Controls.Button
System.Windows.Forms.Button
我又发现了,还有:
System.Windows.Forms.ButtonBase我更不明白了,到底是怎样的一个继承关系呀?
我不知如何看?
是 system.windows.controls呢?
还是 system.windows.forms?在对象浏览器中,有下面两个,所以我不明白,button的基类是 controls呢?还是 forms呢?
System.Windows.Controls.Button
System.Windows.Forms.Button
我又发现了,还有:
System.Windows.Forms.ButtonBase我更不明白了,到底是怎样的一个继承关系呀?
解决方案 »
- c# mediaplayer控件的问题
- 关于ISampleGrabberCB回调函数的问题
- 关于获得鼠标位置 如何获得鼠标相对于窗口的位置?
- 这条不懂啊,想不通啊,求前辈解释一下。先谢谢
- c# 如何引用PB的DLL文件
- vs 2005中,如何触发TreeNodeCheckchanged事件?
- ICollectionBase接口实现IList、ICollection、IEnumeraber三个接口,但是ICollection已经实现了IEnumeraber,那么ICollection为什么还要实
- winform中单击datagrid的标题列,我怎样才能获得这个列的index?我已经把它变成了模板列了
- 在线求等大神解决Dataset转换成List问题
- C#有动态数组吗?如果没有怎么把一个字符串split到一个数组?怎么区数组的上下界?
- 关于多线程同步的问题,精通多线程机制的请进
- Identity和Uniqueidentifier的优劣
命名空间: System.Web.UI.WebControls
程序集: System.Web(在 System.Web.dll 中)
public class Button : WebControl, IButtonControl, IPostBackEventHandler表示 Windows 按钮控件。
命名空间: System.Windows.Forms
程序集: System.Windows.Forms(在 System.Windows.Forms.dll 中)
public class Button : ButtonBase, IButtonControl
可是
System.Windows.Controls下也有button
我不明白System.Windows.Controls
与
System.Windows.Forms
是什么关系,是平级的吗?还有父与子的关系呢?
程序集:System.Windows.Forms(在 system.windows.forms.dll 中)
System.Windows.Controls 命名空间
.提供一些类以创建称为控件的元素,从而使用户可使用这些元素与应用程序进行交互
MessageBox.Show(obj.BaseType.Name);
可以看到基类类型。
我试了,不行呀。
BaseType好象没有这个关键字呀?
MessageBox.Show(obj.GetType().BaseType.Name);
MessageBox.Show(obj.GetType().BaseType.Name);这样看一下它的输出吧
就什么都明白 了,同时也教了你一个举一反三的办法,用户你想知道任何对象的类型,基类都可以用这种方式得到解答~
值得感谢