Hello :)
I have a textbox in a form which is accessed by another form, and i can't understand why the textbox text is null.
adaugaPolitaRca adaugare1 = (adaugaPolitaRca)Application.OpenForms["adaugaPolitaRca"];
TextBox tb = adaugare1.codClientTxt;
MessageBox.Show(tb.Text);//displays nothing even though i write text in the textbox
Does anybody know what's wrong?
Loading

VulpesPosted Apr 25, 2013, 7:14 PM
Violeta PopaPosted Apr 25, 2013, 6:43 PM
Violeta PopaPosted Apr 25, 2013, 6:19 PM
VulpesPosted Apr 25, 2013, 10:42 AM
Years ago there was a problem with McAfee's antivirus software which caused message boxes not to display anything.
They eventually issued a patch for it though you could temporarily fix it by disabling buffer overrun checks in the McAfee console.
If you're running an antivirus program, I'd try temporarily disabling it to see whether this could be anything to do with the problem you're currently experiencing.
VulpesPosted Apr 25, 2013, 8:34 AM
Just as an experiment, insert the highlighted line and see if it changes Form2's title to what's in the texbox:
this.Text = tb.Text;
Violeta PopaPosted Apr 25, 2013, 5:44 AM
If so..this code is not running from the main form.
To be more explicit, in the main form i have a button, when i click this button "adaugare1" form is opened, here is the codClientTxt...i write text in that textbox and I have another button in this form, when i click it the code above runs.
VulpesPosted Apr 25, 2013, 5:33 AM
If you are sure, then is that code running in a different thread to the main UI thread?