Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to access parent window variables from child window 1

Status
Not open for further replies.

mbutch

Programmer
Nov 17, 2000
100
US
Can you pass information to a child window from a parent window opened with the ShowDialog() method?

Mike
 
in the child window create a global object of whatever type it's parent is. set a property up so that is may be set/get (get probably isn't that important here, but let's do it properly). before you call 'myChild.ShowDialog()', pass the parent to it with a piece of code that will look a bit like 'myChild.parentProperty = this'. the cild now has a reference to it's parent, use it as you wish.

____________________________________________________
If you like a post, show you care by giving it a star.
 
Great idea.

Thank you very much,

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top