public void LogOut_event(object sender, EventArgs e) { this.Hide(); //Log Out SecurityControl.AccIndex = -1; //Start Login form SecurityControl.LogOut_event(sender, e); //take index of the account Interface.ActiveAccountIndex = SecurityControl.AccIndex; //Write acc name on the menu item Interface.AccBox_Add(); //restore form LoadAccountSettings(); this.Show(); }