As another posted said you can use this.GetType() to find out the
instantiated type. However, I would be very wary of any behavior that
depended on this type of setup as it sounds like it'll be a
maintenance hassle down the road and certainly be very confusing.
If you need the child forms to do somethign special then create a
virtual method, for example:
private void closeButton_Click(object sender, EventArgs e) {
OnBeforeCloseClick();
.. do something
OnAfterCloseClick();
}
protected virtual void OnBeforeCloseClick() {
// for extension
}
proteced virtual void OnAfterCloseClick() {
// for extension
}
HTH,
Sam
------------------------------------------------------------
We're hiring! B-Line Medical is seeking Mid/Sr. .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.
On Wed, 22 Nov 2006 01:32:01 -0800, Soobrassen Thoplan
<so*****@yahoo.comwrote:
>
HI guys,
I am developing an application using c# sharp.I have a base form and all
other forms inherits from the base form.
all was running so well until i was given the task to find out which
inherited form is actually being used.
i.e i have a button in my base form and on clicking that button i want to
know which child is accessing the base form currently..
Please if this is possible then let me know ....
Lots of thanks in advance.