I have buttons which validate if the user is administrator or not. If the user currently login is not an administrator then label will show as warning message and then hide after a few seconds. I tried using lblWarning.Hide();
and lblWarning.Dispose();
after the warning message, but the problem is, it hides the message before even showing the warning message. This is my code.
private void button6_Click(object sender, EventArgs e)
{
if (txtLog.Text=="administrator")
{
Dialog();
}
else
{
lblWarning.Text = "This action is for administrator only.";
lblWarning.Hide();
}
}