"接口"对于表单对象 [英] "Interface" for a form object
问题描述
我知道这听起来很愚蠢,但无论如何我都要继续。
我想创建一个实现表单所有方法的界面,
再加上一两个。但我需要知道是否有一个接口
定义所有表单方法等。在下面的示例中
" System.Windows.Forms.Form"不是一个界面,但它得到了我的观点
。我可以在这里替换一个表单的界面吗?
再次谢谢
Tony
Public Interface interfaceSuperForm
继承System.Windows.Forms.Form
Sub sub1(byVal i As Integer)
Sub sub2(byVal i As Integer)
结束界面
I know this sounds stupid but I am going to carry on anyway.
I want to create an interface that implements all methods of a form,
plus another one or two. But I need to know if there is an interface
that defines all a forms methods etc. In the example below
"System.Windows.Forms.Form" isn''t an interface, but it gets my point
across. Is there an interface for a form that I can substitute here?
Thank you again
Tony
Public Interface interfaceSuperForm
Inherits System.Windows.Forms.Form
Sub sub1(byVal i As Integer)
Sub sub2(byVal i As Integer)
End Interface
推荐答案
你好,
我想创建一个实现a的所有方法的接口形式,
再加上一两个。但是我需要知道是否有一个定义所有表单方法等的接口。在下面的示例中,System.Windows.Forms.Form不是一个界面,但它得到我的意见
。我可以在这里替换一个表单的界面吗?
再次感谢你
Tony
没有表单的界面对象。你为什么要宣布一个
的界面?你确定它是你想要的而不是派生类吗?只需
创建一个派生自System.Windows.Forms.Form的类,并添加额外的
功能。一个接口不应该定义一个类的行为,它会定义一个类的外观。
Nick。
-
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
无论如何。无论结果如何,你都会被改变。
Fergus - 2003年9月5日
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \\ \\ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
" Antony" <到**************** @ hotmail.com>在消息中写道
news:37 ************************** @ posting.google.c om ...我知道这听起来很愚蠢,但无论如何我都会继续。
公共接口interfaceSuperForm
继承System.Windows.Forms.Form
Sub sub1(byVal i作为整数)
Sub sub2(byVal i As Integer)
End Interface
I want to create an interface that implements all methods of a form,
plus another one or two. But I need to know if there is an interface
that defines all a forms methods etc. In the example below
"System.Windows.Forms.Form" isn''t an interface, but it gets my point
across. Is there an interface for a form that I can substitute here?
Thank you again
Tony
There isn''t an interface object for a form. Why do you want to declare an
interface? are you sure it''s what you want and not a derived class? Just
make a class derived from System.Windows.Forms.Form and add your extra
functionality. An interface isn''t supposed to define how a class acts, it
defines how a class should look.
Nick.
--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."
Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"Antony" <to****************@hotmail.com> wrote in message
news:37**************************@posting.google.c om... I know this sounds stupid but I am going to carry on anyway.
Public Interface interfaceSuperForm
Inherits System.Windows.Forms.Form
Sub sub1(byVal i As Integer)
Sub sub2(byVal i As Integer)
End Interface
" Antony" <到**************** @ hotmail.com> schrieb
"Antony" <to****************@hotmail.com> schrieb
我知道这听起来很愚蠢,但无论如何我都会继续。
我想创建一个实现
表单所有方法的接口,加上另外一两个。但是我需要知道是否有定义所有表单方法等的
接口。在下面的示例
中,System.Windows.Forms.Form不是一个界面,但它得到了我的
点。我可以在这里替换表格的界面吗?
不,我不这么认为。你的意图是什么?
再次感谢你
$
公共接口interfaceSuperForm
继承System.Windows.Forms.Form
Sub sub1(byVal i As Integer)
Sub sub2(byVal i As Integer)
End Interface
I know this sounds stupid but I am going to carry on anyway.
I want to create an interface that implements all methods of a
form, plus another one or two. But I need to know if there is an
interface that defines all a forms methods etc. In the example
below "System.Windows.Forms.Form" isn''t an interface, but it gets my
point across. Is there an interface for a form that I can substitute
here?
No, I don''t think so. What''s your intention?
Thank you again
Tony
Public Interface interfaceSuperForm
Inherits System.Windows.Forms.Form
Sub sub1(byVal i As Integer)
Sub sub2(byVal i As Integer)
End Interface
-
Armin
--
Armin
嗨Tony,
这是表格的继承层:
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
System.Windows.Forms.ScrollableControl
System.Windows.Forms.ContainerControl
System.Windows.Forms.Form
Nary一个界面即将到来。你有很多打字要做。 : - (
问候,
Fergus
Hi Tony,
This is the inheritance heirarchy for Forms:
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
System.Windows.Forms.ScrollableControl
System.Windows.Forms.ContainerControl
System.Windows.Forms.Form
Nary an Interface in sight. You''ve got lots of typing to do. :-(
Regards,
Fergus
这篇关于"接口"对于表单对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!