You are viewing our Forum Archives. To view or take place in current topics click here.
C# - Need Some Help With An Error
Posted:

C# - Need Some Help With An ErrorPosted:

M0D1F13D
  • TTG Senior
Status: Offline
Joined: Sep 06, 201014Year Member
Posts: 1,069
Reputation Power: 47
Status: Offline
Joined: Sep 06, 201014Year Member
Posts: 1,069
Reputation Power: 47
Here's the code:
[ Register or Signin to view external links. ]

And here's the error:
[ Register or Signin to view external links. ]
#2. Posted:
Experiment5X
  • TTG Senior
Status: Offline
Joined: Aug 14, 200915Year Member
Posts: 1,291
Reputation Power: 65
Status: Offline
Joined: Aug 14, 200915Year Member
Posts: 1,291
Reputation Power: 65
It's because textBox1 isn't static. So your gonna have to access it through an instance of Form1.

Form1 form = new Form1();
form.textBox1.Text = "Experiment5X";
#3. Posted:
M0D1F13D
  • TTG Senior
Status: Offline
Joined: Sep 06, 201014Year Member
Posts: 1,069
Reputation Power: 47
Status: Offline
Joined: Sep 06, 201014Year Member
Posts: 1,069
Reputation Power: 47
Experiment5X wrote It's because textBox1 isn't static. So your gonna have to access it through an instance of Form1.

Form1 form = new Form1();
form.textBox1.Text = "Experiment5X";

Thanks it worked fine, +Rep.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.