How to access a variable from mdi form to child form

G

Gomathi

hi all,

I have a MDI form(mdiMain). In that timer tick event i have a variable
called intWt.
I want to access that variable into another form called (frmChild). How to
access that variable?

Gomathi
 
B

Bob Powell [MVP]

Create a public accessor property in the form just as you would for a
control.

Alternatively, if you have more than one MDI child type in your application
you might want to do one of the following:

#1 Make all your child types derive from a custom base class with a property
as described above or..

#2 Define an interface that can be implemented by all child types that need
to supply this data.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top