I have Two windows MainWindow and Login. The button which shows login located on mainWindow
this.Hide();
Login li = new Login();
li.Show();
on Login Window is button which checks password how i can show MainWindow if password is correct?
pass a parameter to the loginwindow of type MainWindow. That allows the Login window to have a reference to the MainWindow:
this.Hide();
Login li = new Login(this);
li.Show();
And the login window:
private MainWindow m_parent;
public Login(MainWindow parent){
m_parent = parent;
}
//Login Succesfull function
private void Succes(){
m_parent.Show();
}