passing values from one mdi child to another

B

Bernie Yaeger

This s/b easy, and I'm sure it is, but I haven't been able to figure it out:
I want to pass the value of a textbox from form1 to form2 - both are child
forms of the mdi parent 'baseform'. form1 opens form2 with
Dim newmdichild As New reportprinter_viewerparam

newmdichild.Text = "Invoice Print"

newmdichild.ShowDialog(Me)

But I can't seem to figure out how to reference textbox1. from form1. I do
not want to use a global variable, as I know how to do that but I'm trying
to avoid extensive development of globals.

Thanks for any help.

Bernie Yaeger
 
B

Bernie Yaeger

Hi Jan,

Tx for your response. I actually found an answer that Herfried provided in
another ng re public properties etc.

Tx for your help.

Bernie
 
H

Herfried K. Wagner [MVP]

* "Bernie Yaeger said:
This s/b easy, and I'm sure it is, but I haven't been able to figure it out:
I want to pass the value of a textbox from form1 to form2 - both are child
forms of the mdi parent 'baseform'. form1 opens form2 with
Dim newmdichild As New reportprinter_viewerparam

newmdichild.Text = "Invoice Print"

newmdichild.ShowDialog(Me)

But I can't seem to figure out how to reference textbox1. from form1. I do
not want to use a global variable, as I know how to do that but I'm trying
to avoid extensive development of globals.

Add a public property to 'Form2' and set this property before showing
it. In the implementation of the property, you can store the value in a
textbox or return the value entered in the textbox.
 
B

Bernie Yaeger

Hi Herfried,

Thanks; as you'll note from my response to Jan, I saw your post in the
windows.forms ng where you answered the question perfectly, as you always
do.

Tx

Bernie
 

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