|
-
Jul 9th, 2007, 12:31 PM
#1
Thread Starter
Frenzied Member
Menu Editor Pain in the .....
I am using the built in Menu Editor in VB6 and I have 'mnuEdit' hidden with various subitems for various different ChildForms, each showing where necessary, and hidden where necessary.
The problem I have is that at least one subitem has to be visible, but I don't have one subitem that is relevant to all ChildForms1
Is there some easy, or obvious workaround to solve this frustrating problem???
-
Jul 9th, 2007, 12:49 PM
#2
Re: Menu Editor Pain in the .....
well then just take the first subitem and make it visible
when one of the subitems needs to be enabled put a standard code line for subitem1.visible = false and then some other is true
or am i not getting the point at all here?
Delete it. They just clutter threads anyway.
-
Jul 9th, 2007, 12:57 PM
#3
Thread Starter
Frenzied Member
Re: Menu Editor Pain in the .....
Say ChildForm ONE has a menu item called "Remove" and this is the one item that has been set to .visible = True in the Menu Editor.
I set which subitems are to used with each ChildForm in the Form_Activate and I close the mnuEdit (where all of the subitems are stored) in the ChildForm_Unload. Not all forms use the mnuEdit menu option.
When I close ChildForm ONE and open ChildForm TWO it won't allow me to set mnuRemove.Visible = False in ChildForm TWO.
-
Jul 9th, 2007, 01:16 PM
#4
Re: Menu Editor Pain in the .....
One possible, although perhaps not as "pretty" alternative, is to keep all menu items visible, but disable/enable them as needed.
-
Jul 9th, 2007, 01:20 PM
#5
Thread Starter
Frenzied Member
Re: Menu Editor Pain in the .....
Thanks Hack.
It's not what I really want to do, but it is an option.
What do you use for menus?
-
Jul 9th, 2007, 01:23 PM
#6
Re: Menu Editor Pain in the .....
Standard menu editor just like you are using.
However, I don't believe in all my years, I've ever had the need to create an MDI application.
My choice is too always disable them. I like to display them as disabled so the user can see them, but can't use them. My boss calls me evil. 
Typically, however, I'm not allowed to do that and have to toggle their visible property.
-
Jul 9th, 2007, 01:26 PM
#7
Thread Starter
Frenzied Member
Re: Menu Editor Pain in the .....
So, in your opinion, as a professional programmer, you think it would look ok to be showing all of the subitems, but with maybe just one of them enabled?
I would be interested if anybody knows a work around for this one.
-
Jul 9th, 2007, 01:35 PM
#8
Re: Menu Editor Pain in the .....
According to Microsoft, best practice is to enable/disable instead of showing/hiding using the visible property. The reason is that when menus change around, it is more disorienting for the user compared to having every menu item in exactly the same place at all times.
I agree with this idea only up to a point. If there are options that aren't just inapplicable, but don't even make sense, then I hide them. Microsoft does this as well; context menus are a place where hiding is better than disabling inapplicable items.
If I understand your situation, though, it's that every form has at least one menu item, but there is no single menu item that is universally applicable for every form.
Seems to me an easy fix. The logic for showing/hiding the menu items should show all the applicable menu items before hiding anything. That way there will always be at least one menu item visible, and it doesn't have to be the same one each time.
-
Jul 9th, 2007, 01:41 PM
#9
Re: Menu Editor Pain in the .....
You could put a separator as the first subitem. Then in the Form_Activate, set the item's caption to "-" (if that child form has no submenu items) or to the text you want for the first subitem on that form. (You'll have to detect which form is active in the submenu's click event, because that sub will fire regardless of the text it shows in the menu. (Or you could just leave it as a separator - if it's a submenu you can make all the other submenu items invisible.)
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
Jul 9th, 2007, 01:42 PM
#10
Thread Starter
Frenzied Member
Re: Menu Editor Pain in the .....
 Originally Posted by Ellis Dee
According to Microsoft, best practice is to enable/disable instead of showing/hiding using the visible property. The reason is that when menus change around, it is more disorienting for the user compared to having every menu item in exactly the same place at all times.
Hmm, this does make sense. 
 Originally Posted by Ellis Dee
If I understand your situation, though, it's that every form has at least one menu item, but there is no single menu item that is universally applicable for every form.
Not quite. All forms show most of the menus, but not all ChildForms have a subitem of this menu - mnuEdit.
 Originally Posted by Ellis Dee
Seems to me an easy fix. The logic for showing/hiding the menu items should show all the applicable menu items before hiding anything. That way there will always be at least one menu item visible, and it doesn't have to be the same one each time.
This is the problem. The item that I have to make visible at design time in the VB Menu Editor is not allowed to be made .visible = false at run time.
Either that, or I have got something wrong somewhere!
-
Jul 9th, 2007, 10:24 PM
#11
Re: Menu Editor Pain in the .....
Oh, now I understand.
I ran into a similar situation, where I have an active submenu with no child items given a specific circumstance. Poking around, I found an example in Windows (either Explorer or regedit) of that behavior, so I copied it. Sadly, I can never remember how to duplicate that behavior when I want to -- like now -- so here's a screenshot of how it looks. (This is a context menu in one of my apps, based on the standard I found in Windows.)
Last edited by Ellis Dee; Sep 21st, 2007 at 09:46 AM.
-
Jul 9th, 2007, 10:30 PM
#12
Re: Menu Editor Pain in the .....
There are any number of ways to set this up. You can either reuse a menu item, or have a dedicated "Empty" item that you make visible/invisible as appropriate.
In my case, I reused the Empty item as a real item if one exists.
-
Jul 9th, 2007, 10:34 PM
#13
Re: Menu Editor Pain in the .....
heh, triple post, geek of the week.
I remembered how to make Windows show an empty folder. In Internet Explorer, go to Favorites => Organize Favorites => Create Folder. Close the dialog and then select that new folder, and you'll see how Microsoft handles empty submenus.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|