Hi everyone,
I want to know if its possible to do the following: I have 2 users and 2 forms. When user A (Admin) logs in on the Log In form, the Main Form appears with ALL its buttons enabled (For editing purposes). BUT when user B (Normal user) logs in the SAME Main From appears BUT the editing buttons are then disabled...
How can I go about this?
All I have at the moment is this:
In the logging in form
private void button1_Click(object sender, EventArgs e)
{
if(textBox1.Text == "Admin" && textBox2.Text == "Admin")
{
//Load main form
MainForm f = new MainForm();
f.ShowDialog();
//f.Disable(button1);
}
else if(textBox1.Text == "User" && textBox2.Text == "User")
{
//Load main form with disabled buttons
MainForm f = new MainForm();
f.ShowDialog();
//f.Disable(button1);
}
else if (textBox1.Text != "Admin" && textBox2.Text != "Admin")
{
MessageBox.Show("Please try logging in correctly for security purposes.");
}
else if (textBox1.Text != "User" && textBox2.Text != "User")
{
MessageBox.Show("Please try logging in correctly for security purposes.");
}
}