Hi
Does anyone know how to make the main menu in a form non responsive.
I have this function which expects the user to pick a point on a pictureBox in the form with the mouse. Until this happens i want to stop the user selecting anything else on the form. The only thing he can selected at the moment is in the main menu that's why i want to make it non responsive for a while.
Any ideas how to make this work.
Much appreciate it.
george

disabling the mainmenu in a form
Matt Bell
Thanks for the help guys. Unfortunately MenuItem does not have a Tag, only Forms and Controls seem to have one (working with C++ under .NET 2003) and i guess menu items are not controls.
Never the less i got the picture which way to go to sort this one out.
Thanks once more
george
niallhannon
Couldn't he just override WndProc and only allow messages to picturebox.handle to be passed
EDIT: Ok, I think the best would be to use a HashTable and store each menuitems enabled state. Disable them all, and when done refer to the hash table to see if they should be enabled or disabled...
ar_pad
Cory6132
The 'Menu' class does not have an 'Enabled' member.
About the 'MenuStrip' i can't find it and the PictureBox->Capture still allows for menu items to be selected. I am using C++ under .NET 2003.
Am i missing something
george
R.Tutus
But it looks like i might have to work with the menu items after all.
Just in case, does anyone know if it would be possible to restrict the mouse from exiting the pictureBox In this way the user wouldn't be able to select anything else. Is this a good idea
george
David Avsajanishvili
Philip Quirke
xRuntime
DC Ross
zybernau
private void button1_Click(object sender, EventArgs e) {
foreach (MenuItem item in mainMenu1.MenuItems)
item.Enabled = !item.Enabled;
}