Enabling/Disabling the menu item from another thread
<p>I am trying to change a menu item from another thread. I am able to use the InvokeRequired/Invoke on other controls, but since the menu item is not a Control, I am having difficulty in achieving the same functionality.</p>

<p>For other controls, I am doing this:</p>

<pre><code>private delegate void SetControlEnableHandler(object sender, Boolean bValue);

private void SetControlEnabled(object sender, Boolean bValue)
{
  Control control = (Control)sender;
  if (control.InvokeRequired)
    control.Invoke(
        new SetControlEnableHandler(SetControlEnabled),
        new object[] { sender, bValue }
    );
  else
    control.Enabled = bValue;
}
</code></pre>

<p>From the worker thread I simple call:</p>

<pre><code>this.SetControlEnabled(btnPress, true);
</code></pre>

<p>and it does the job.</p>

<p>Can anyone help me with the menu item here?</p>

<p>Thank You,
-Bhaskar</p>
