Displaying MessageBox when disabled menu item is clicked
<p>I want to display a message box when any person clicks on the menu item which is not enabled I have tried the following coding but it is not displaying the message box.</p>

<p>Coding:</p>

<pre><code>private void updateFineDetailsToolStripMenuItem_Click(object sender, EventArgs e)
{
    if (updateFineDetailsToolStripMenuItem.Enabled == true)
    {
        frmUpdateFineDetails objUpdateFineDetails = new frmUpdateFineDetails();
        objUpdateFineDetails.MdiParent = this;
        objUpdateFineDetails.Show();
    }
    else if (updateFineDetailsToolStripMenuItem.Enabled == false)
    {
        MessageBox.Show("Unauthorized Person");
    }
}
</code></pre>

<p>By default I have set the enabled status to false and when the form loads I am checking whether the user is administrator, if the user is admin then this menu item will be enabled for all other user who logs into the application the above menu item has to be disabled.</p>

<p>Please note that the above coding does not generate any error, but it does not even display the messagebox as unauthorized person.</p>

<p>Can anybody help me out in performing this task?</p>

<p>Thanks in advance!</p>
