I have two classes test.cs and designTest.cs
In designTest.cs ,I have label1,textbox1,combobox1 etc.
In the test.cs,I want to write the code as
designTest dt=new designTest();
//label1.visible=true;
//textbox1.visible=true;
but the problem is that label1,textbox1 or combobox1 is not accessible.
How to make them accessible in test.cs?
How to access textbox/labels/combobox from another class.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Jaish MathewsRank #225 · 11K reputationPosted May 9, 2010, 11:45 PM EDT
In "designTest" class declare public properties, which will return your Labels, TextBoxes etc...Some thing like below
class designTest
{
public TextBox MyTextBox1
{
<
}
}
Kriti54 reputationPosted May 9, 2010, 11:47 PM EDT