Cross form variables !!....

  • Thread starter Thread starter John Medany
  • Start date Start date
J

John Medany

OK - After my DB nightmares this should be straight forward but i cant work
it out ...

How do I get a variable (in this case the value of a text box from one form
into another ???

Help

John
 
Stick a public property on the form that returns the value of the textbox.

What language are you using? In VB a worst alternative is to directly access
the textbox (since by default it is declared with Friend) e.g.
instanceOfForm.TextBox1.Text

Cheers
Daniel
 
Thanks Daniel

I'm using C#

New to this obviously and trying to get up to speed
Can some one give me code exmple of a straight way of getting a string
available in form.

john
 
So you don't know what a property is? Here is sample (air)code:

public string SomeText{
get{
return textBox1.Text;
}
}

Cheers
Daniel
 
Back
Top