Click here to Skip to main content
15,901,205 members

Comments by Francine DeGrood Taylor (Top 23 by date)

Francine DeGrood Taylor 27-Jun-14 12:42pm View    
MenuControl is the menu control for a form. You instantiate one and assign it to your form's .Menu property. I'll modify the code to show that.

What you need are a collection of objects (call them MenuItem) each representing a menu. Each of these objects has a list of MenuItems, each representing a menu selection. They have to be the same object type if you want to call them recursively. The "top" parent level object can also contain information about the menu as a whole (in the selection objects those properties would be unused).

If you want to give the menu and selection different classes (so you don't have unused properties) that would work as well. When you create your menu just pass the top level selection objects to the recursive method (I'll write you up a code example of what I'm talking about if you'd like)
Francine DeGrood Taylor 27-Jun-14 12:41pm View    
Thanks! I was having the darndest time getting this code formatted, for some reason.
Francine DeGrood Taylor 26-Jun-14 18:27pm View    
Oops, bug fix just now...The line that recursively calls BuildMenus in BuildMenus should have sent newItem, not menuItem.
Francine DeGrood Taylor 16-Jun-14 13:02pm View    
Unfortunately, this doesn't seem to work either. I set up a sample form using it, and can successfully block any other key combination, but alt-tab is not blocked.
Francine DeGrood Taylor 13-Jun-14 18:27pm View    
What are you trying to do? Do you just want to give the datagridview columns the same name as the columns that they were filled from? Or do you want to create the columns first, in a particular order and load them with data from the corresponding column?