Newbie: Passing variable values

A

Adriano

hello,

i have parent MDI and child inside, parent MDI has a string variable var1 =
"somestring", how can pass that value to, say, textbox of the child form?

Regards,

Adriano
 
C

Cor Ligthert

Adrianno,

You can forever pass a value from a mdi.parent to its childs just using
myMdiChildForm.itsTextbox.text = "Wathever"

(assuming you instanced it directly with dim myMDiChildForm as new
mychildform)

I hope this helps?

Cor
 
A

Adriano

hello Cor,
thanks for reply,

what if I pass VARIABLE instead of textbox.text value from parent to child
MDI, how would the code look like?

thanks in advance,
Adriano
 
C

Cor Ligthert

Adriano,

Exactly the same

However you would have to make that variable public or friend in your
midiform. Or really nice a property but that is in my opinion not really
needed here.

Cor
 
A

Adriano

thanks again for your reply,
i have the last question :)

what would the code look like if I call the variable declared in parent MDI
from child MDI? for example I have a TextBox1 in child form and have alredy
declared var1 = "somestring" string variable in my parent MDI, so
TextBox1.text = ???

many thanks in advance,
Adriano
 
C

Cor Ligthert

Adriano,

Hopefully not as you write it, however

public var1 as String

and than is the answer var1

Cor

"Adriano"
thanks again for your reply,
 

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