
November 12th, 2009, 01:24 PM
|
|
Registered User
|
|
Join Date: Nov 2009
Posts: 1
Time spent in forums: 22 m 38 sec
Reputation Power: 0
|
|
|
Changing object in a Form through a Class
Hello, I want to state a problem for which wherever I have searched for help, I cannot get an answer.
In C# 2008, I have the main form called Form1 and a class called Class1 containing a function which is summoned from the main Form.
In the last lines of the function I have put those lines
Form1 lab = new Form1();
lab.pictureBox1.Refresh();
lab.btn2.Text = "grayscale";
lab.button1.Text = "Restore to Grayscale";
lab.button1.Width = 120;
The "button1", "btn2", and "pictureBox1" are all "Modifiers=public" in Form1. The problem isn't there.
When I am running the code, C# decides to ignore those 5 lines for a reason I cannot understand
As I get it, the problem must be in the first line, but cannot fix it. Help me please.
|