PC Review


Reply
Thread Tools Rate Thread

obtain a reference to a derived form in its base form

 
 
Daniel
Guest
Posts: n/a
 
      26th Oct 2004
Hi,

I need to catch an exception (same exception) in many forms (tens+) derived
from a base form; so I thought to make 2 methods in the base form that
should handle the exception;
the problem is that the code must set some properties in a mdi form, derived
from the base form;
now, how can I get a reference, of any kind, to that derived form in its
base form?

Thank you,
Daniel


 
Reply With Quote
 
 
 
 
Girish bharadwaj
Guest
Posts: n/a
 
      26th Oct 2004
if its within a virtual method, you can just use the *this* in C# or *Me* in
VB to get to the derived form.
You might want to look into "Template method" pattern. Search the web for
that.

--
Girish Bharadwaj
http://msmvps.com/gbvb
"Daniel" <bbb> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I need to catch an exception (same exception) in many forms (tens+)
> derived
> from a base form; so I thought to make 2 methods in the base form that
> should handle the exception;
> the problem is that the code must set some properties in a mdi form,
> derived
> from the base form;
> now, how can I get a reference, of any kind, to that derived form in its
> base form?
>
> Thank you,
> Daniel
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to obtain a reference to derived class from base? =?Utf-8?B?U2lkIERlTHVjYQ==?= Microsoft Dot NET Framework 2 22nd Oct 2007 09:24 PM
Copying a derived type to another type that inherits from derived type Bob Jones Microsoft C# .NET 3 2nd Jul 2007 02:47 PM
Copying a derived type to another type that inherits from derived type Options Bob Jones Microsoft C# .NET 1 29th Jun 2007 10:26 PM
Issues Serializing A Derived Class and its Base using IXmlSerializable, Can't See Base Peter Nofelt Microsoft Dot NET 1 10th Feb 2006 10:30 PM
Cannot open derived form in design view if the base form is marked 'abstract'. Yasutaka Ito Microsoft Dot NET Framework Forms 3 26th Jan 2004 05:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:11 PM.