Hi,
I have a usercontrol with a overridable/virtual method. On the usercontrol
onload, it will call this method.
Now I have a form that have a few of this usercontrol.
And I want to override the method in each usercontrol, how do I accomplish
this?
Thanks,
Tee 3 2251
"Tee" <th*@streamyx.com> wrote in message
news:ud**************@TK2MSFTNGP10.phx.gbl... Hi,
I have a usercontrol with a overridable/virtual method. On the usercontrol onload, it will call this method.
Now I have a form that have a few of this usercontrol. And I want to override the method in each usercontrol, how do I accomplish this?
public class ChildControl : ParentControl {
public override void MyMethod() {
base.MyMethod();
}
}
Thanks, Tee
I'm not inheriting it ...
Any idea?
"Sean Hederman" <us***@blogentry.com> wrote in message
news:ct**********@ctb-nnrp2.saix.net... "Tee" <th*@streamyx.com> wrote in message news:ud**************@TK2MSFTNGP10.phx.gbl... Hi,
I have a usercontrol with a overridable/virtual method. On the
usercontrol onload, it will call this method.
Now I have a form that have a few of this usercontrol. And I want to override the method in each usercontrol, how do I
accomplish this?
public class ChildControl : ParentControl {
public override void MyMethod() { base.MyMethod(); }
}
Thanks, Tee
"Tee" <th*@streamyx.com> wrote in message
news:%2******************@TK2MSFTNGP14.phx.gbl... I'm not inheriting it ...
Any idea?
Overriding is a property of derived classes, so if you're not inheriting it,
AFAIK you can't override it. If you have access to the source of the
controls you could change them to call a delegate instead of the overridable
method, and then make that delegate settable from outside the control. It
would be a pretty nasty solution though.
"Sean Hederman" <us***@blogentry.com> wrote in message news:ct**********@ctb-nnrp2.saix.net... "Tee" <th*@streamyx.com> wrote in message news:ud**************@TK2MSFTNGP10.phx.gbl... > Hi, > > I have a usercontrol with a overridable/virtual method. On the usercontrol > onload, it will call this method. > > Now I have a form that have a few of this usercontrol. > And I want to override the method in each usercontrol, how do I accomplish > this?
public class ChildControl : ParentControl {
public override void MyMethod() { base.MyMethod(); }
}
> > > Thanks, > Tee > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Tee |
last post by:
Hi,
I have a usercontrol with a overridable/virtual method. On the usercontrol
onload, it will call this method.
Now I have a form that have a few of this usercontrol.
And I want to override...
|
by: Tee |
last post by:
Hi,
I have a usercontrol with a overridable/virtual method. On the usercontrol
onload, it will call this method.
Now I have a form that have a few of this usercontrol.
And I want to override...
|
by: Tee |
last post by:
Hi,
I have a usercontrol with a overridable/virtual method. On the usercontrol
onload, it will call this method.
Now I have a form that have a few of this usercontrol.
And I want to override...
|
by: Joshua |
last post by:
I'm creating a web control that has an image and a text box. I would
like to then override the Visible and Text property of the
usercontrol, so when you reference the visible property of the user...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |