|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Sharing references/members..Net 2003 V- 7.1.3088
Framework 1.1 V- 1.1.4322 SP1 WinXp SP2 I'm building a WinForms project and I have 3 levels of forms( the MDI Form, a MDI child form, and a modal form called from the MDI child form ). I have a member declared in the MDI Form that I need to be able to manipulate from within the other two forms and I'm not sure of the best way to go about this ( I'm used to ASP.net, where I would simply put this in the Session object and call it from each page ). Can anyone point me in the right direction here? Thanks!!! Tom S. Tom,
Create a new property for your MDI form that exposes the object you require. Then, from the child form: ---- Me.MdiParent.YourProperty.SomeMethod() ---- For the modal form to access the property you need to pass a reference to the MDI parent somehow. I personally suggest passing the reference as an argument to the modal form's constructor. Regards, -Adam. Tom S. wrote: Show quoteHide quote > .Net 2003 V- 7.1.3088 > Framework 1.1 V- 1.1.4322 SP1 > WinXp SP2 > > I'm building a WinForms project and I have 3 levels of > forms( the MDI Form, a MDI child form, and a modal form > called from the MDI child form ). I have a member > declared in the MDI Form that I need to be able to > manipulate from within the other two forms and I'm not > sure of the best way to go about this ( I'm used to > ASP.net, where I would simply put this in the Session > object and call it from each page ). Can anyone point me > in the right direction here? Thanks!!! > > Tom S. That works perfectly, Thanks!!!!!
>-----Original Message----- object you require.>Tom, > >Create a new property for your MDI form that exposes the > pass a reference >Then, from the child form: > >---- >Me.MdiParent.YourProperty.SomeMethod() >---- > >For the modal form to access the property you need to >to the MDI parent somehow. I personally suggest passing the reference as Show quoteHide quote >an argument to the modal form's constructor. > >Regards, >-Adam. > >Tom S. wrote: >> .Net 2003 V- 7.1.3088 >> Framework 1.1 V- 1.1.4322 SP1 >> WinXp SP2 >> >> I'm building a WinForms project and I have 3 levels of >> forms( the MDI Form, a MDI child form, and a modal form >> called from the MDI child form ). I have a member >> declared in the MDI Form that I need to be able to >> manipulate from within the other two forms and I'm not >> sure of the best way to go about this ( I'm used to >> ASP.net, where I would simply put this in the Session >> object and call it from each page ). Can anyone point me >> in the right direction here? Thanks!!! >> >> Tom S. >. >
Why use Events?
ownerdraw menu, help appreciated Help with Debugging VB6 - Unable to read Text File Best way to get the value of one particular node of an XML string iHttpModule and Virtual Directories Custom Collections : overriding toString Application class problem How to code for receiving data via modem? VB.NET and Palm Pilots |
|||||||||||||||||||||||