Even if you create a property to hold the instance the of form containing the control, what is the problem that requires the control to be aware of the form container that it is contained in?
Kind Regards Arjang On 24 June 2010 10:50, Anthony <[email protected]> wrote: > Agree with you..but was hoping to save some effort setting a property for > all instances of my control. I guess i should just add a property and go > for it..lazy me! > > > > From: [email protected] [mailto:[email protected]] > On Behalf Of David Kean > Sent: Thursday, 24 June 2010 10:41 AM > To: ozDotNet > Subject: RE: Get main form instance from usercontrol > > > > What are you trying to do? A user control should try and be naive to where > it’s being hosted – I typically have these communicate to the form hosting > it by using events and properties. > > > > From: [email protected] [mailto:[email protected]] > On Behalf Of Joseph Clark > Sent: Wednesday, June 23, 2010 5:31 PM > To: ozDotNet > Subject: Re: Get main form instance from usercontrol > > > > http://msdn.microsoft.com/en-us/library/system.windows.forms.control.findform.aspx > should work? > > On Thu, Jun 24, 2010 at 10:25 AM, Anthony <[email protected]> wrote: > > What method do i need to use to the get the main instance of a form from a > usercontrol? > > > > The main form is of type FormMain but how do i access the instance from a > usercontrol? If i use me.parent..this would only give the instance of the > container object. Using vb.net winforms > > > > Is your website being IntelliXperienced? > regards > Anthony (*12QWERNB*) > > Is your website being IntelliXperienced? > > > > > >
