I have form1 and class1. I would like to use a method to read/write the text in a textbox in form1 at class1. This is the segment of the program. I currently able to interact between those two. The only problem is I do not how to convert the string to a form which can be read.
In form1:
public string readTxt(string txtbox_name)
{
string txtbox_val;
txtbox_val = (txtbox_name).Text; //problem here
return txtbox_val;
}
public void writeTxt(string txtbox_name,string txtbox_val)
{
(txtbox_name).Text = txtbox_val; //problem here
}
For example i need to read/write value in textbox1.
In class1:
string text1 = (readTxt(textbox1)); //for get the text in textbox1
string text2 = "Hello"
writeTxt(textbox1,text2); //for overwrite the text in textbox1 to "Hello"
Sorry for the question quite confusing due to not good in ask question.