Today I account a question, In c# winform program.
if there are Form A and Form B; Form B has a textbox (need to read only)
The Form A code like this:
B b = new B("FormB");
b.Show();
The FormB code like this:
Situation1:
public B(string str)
{
this.textbox1.text = str;
this.textbox1.Enable = false;
}
I deploy the program to customer server, but the textbox1.text = ""
, have no value, but it works in my local computer.
I try this:
Situation2:
public B(string str)
{
this.textbox1.text = str;
this.textbox1.ReadOnly = true;
}
Then texbox1.text = "FormB";
it works in my local computer and customer server.
The key and important question is ,why the situation1 can works my local computer not works in customer server?
Can anybody tell this is why?