First create a public string on your second form you want to pass the data from login:
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
public string messagefromLogin;
MessageBox.Show(messagefromLogin);
}
then on your login:
public partial class LoginForm : Form
{
public LoginForm()
{
InitializeComponent();
}
private string somedata = "somedata";
//Show Form2 and pass the string "somedata"
private void btnShowForm2_Click(object sender, EventArgs e)
{
var frm2 = new Form2{messagefromLogin=somedata}
frm2.Show();
}
}
Regards