Hi 2000sam,
Please try the following code.
In form1:
| publicpartialclassForm1:Form |
| { |
| publicForm1() |
| { |
| InitializeComponent(); |
| this.textBox1.TextChanged+=newEventHandler(textBox1_TextChanged); |
| } |
|
| voidtextBox1_TextChanged(objectsender,EventArgse) |
| { |
| if(this.textBox1.Text=="1234") |
| { |
| Form2f=newForm2(); |
| f.Lable1.Text="Nikos"; |
| f.ShowDialog(); |
| } |
| } |
| } |
In form2:
| publicpartialclassForm2:Form |
| { |
| publicForm2() |
| { |
| InitializeComponent(); |
| } |
| publicLabelLable1 |
| { |
| get |
| { |
| returnthis.label1; |
| } |
| set |
| { |
| this.label1=value; |
| } |
| } |
| } |
If you have any problem, please feel free to let me know.
Best regards,
Bruce Zhou
Please mark the replies as answers if they help and unmark if they don't.