Ok here is the scenario:
I have an mdi form with a menu strip on it. Has a button on the menu strip that is for manager login.
When login is successful. I want to hide the login form or close it for that matter, and update the menu strip to show other menus etc.
Can someone point me in the right direction?
Hemant SrivastavaPosted Dec 28, 2015, 2:39 PM
Try this:
public partial class Form1 : Form
{
Point p = new Point(0, 0);
public Form1()
{
InitializeComponent();
menuStrip_Login.Location = p;
menuStrip_Regular.Hide();
}
private void toolStripMenuItem1_Click(object sender, EventArgs e)
{
//Here you will open Login Form and capture the Dialog result of your login form in dr variable
DialogResult dr = MessageBox.Show("Login Form", "Login", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
if (dr == DialogResult.OK)
{
menuStrip_Login.Hide();
menuStrip_Regular.Show();
}
}
}
Hemant SrivastavaPosted Dec 28, 2015, 2:36 PM
Hi Marcus,
The above scenario you may achieve by adding two Menu Strips (say first one is regular and another is for Login purpose). Your Regular Menustrip's location would be 0,0 and Login menustrip would be 0, x pixels.