i have problem with using a method of a form in another form
EDITED:
i coded like this:
(i entered 123 in textbox1)
public class Form1 : Form
{
private string user_code;
public string UserCode
{
get { return user_code; }
}
public bool LoginUser()
{
user_code = null;
if(textBox1.Text=="123"){
user_code="usercode";
}
*
*/
}
}
and usage in form2:
Form1 form1 = new Form1();
form1.LoginUser();
MessageBox.Show(form1.UserName);
now output is an empty string,i checked with breakpoint and i saw that when i call loginuser in form2 the value in textbox1 become empty and if condition become false
what do you think about problem??
I solved my problem with this link: