Dear friend there is 2 way but I guess u
forgot something:
U cant use them in
body of class I mean like this
Code:
class myClass
{
bo1.Text = ...
}
& inorder to access them u shoul duse them in Methods of class like:
Code:
class myClass
{
public myClass()
{
bo1.Text = ...
}}
[u]& thoes 2 ways</u>
1.
Code:
class Form1
{
//All control in this class
public ListBox list1 = new ListBox();
public TextBox box1 = new TextBox();
}
Code:
class MyClass
{
public MyClass()
{
Form1 F1 = new Form1();
Form1.box1 = 1;
}
}
2.
Code:
static class Form1
{
//All control in this class
public static ListBox list1 = new ListBox();
public static TextBox box1 = new TextBox();
}
Code:
public MyClass()
{
Form1.box1 = ...;
}
Always:),
Hovik Melkomian.