i want to read txtbox1.text from another class so i made this
and changed the txtboxes modfiers to public but the problem is
even there is text in the textboxes the messagebox shows them empty
(idk what is the problem now)
UPDATE : HERE IS WHAT I WANT TO DO EXACTLY
What i really want to do is as the following
i have Form1 that has 2 textboxes and a button
and have login.cs which is the class that will handle the login process
so what i want to do is transfer the 2 textboxes values to the login class so the login class can determine whether the login info are correct or not
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Mains;
public class iWebWrap
{
public void login()
{
OptimumMain om = new OptimumMain();
string username = om.txtWebUser.Text;
string password = om.txtWebPass.Text;
MessageBox.Show(username);
MessageBox.Show(password);
}
}
even there is text in the textboxes the messagebox shows them empty
(idk what is the problem now)
UPDATE : HERE IS WHAT I WANT TO DO EXACTLY
What i really want to do is as the following
i have Form1 that has 2 textboxes and a button
and have login.cs which is the class that will handle the login process
so what i want to do is transfer the 2 textboxes values to the login class so the login class can determine whether the login info are correct or not