-
Nov 23rd, 2015, 04:12 PM
#1
[RESOLVED] Menu Item Question
How do I set the caption to bold on a menu submenu
Last edited by jmsrickland; Nov 24th, 2015 at 12:23 AM.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Nov 23rd, 2015, 04:22 PM
#2
-
Nov 23rd, 2015, 05:19 PM
#3
Re: Menu Item Question
If you are talking about a context menu that you created in VB, the PopupMenu command's final parameter will bold that menu item when it is displayed. Otherwise, APIs are likely needed as may be in Sam's link?
-
Nov 23rd, 2015, 09:23 PM
#4
Re: [RESOLVED] Menu Item Question
Its nice to see planetsourcecode.com is back online.
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
-
Nov 24th, 2015, 12:23 AM
#5
Re: [RESOLVED] Menu Item Question
I thought Sam's link would do the job but unfortunately, it doesn't work if the main menu is invisible
I'm using this as a popupmenu so only the submenus are visible but it only appears to work as long as the main menu is visible
EDIT: I tried leaving the .Caption blank and that works but the buttons are still on the menu bar so that approach is out. I then tried using a bitmap which also works but then once it is highlighted it looks ugly: blue and black background with white letters so again that approach is out.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Nov 24th, 2015, 03:55 AM
#6
Re: Menu Item Question
Do you need more than 1 item in bold (that's bad programming standards)? If not just specify which one in the last parameter of PopupMenu like LaVolpe said.
Otherwise, you're going to have to go so deep into subclassing that you'd be better off just making your own API popup menu (easier than subclassing, plus on Vista+ using pretty icons of any size is easy).
-
Nov 24th, 2015, 08:52 AM
#7
Re: Menu Item Question
@JM. Bolded menu items indicate a shortcut for default menu. Per MSDN: "The default command is invoked when users double-click or select an object and press Enter." In other words, instead of right clicking on something, selecting the bolded popup menu item, the user can simply double click on it. Only 1 submenu item in the popup/context menu should ever be bolded; else you risk confusing your user.
If this is indeed a context menu scenario you are describing, my first reply should work.
P.S. non-visible menus/menuitems are created on demand in VB when you display them.
-
Nov 24th, 2015, 10:32 AM
#8
Re: Menu Item Question
Originally Posted by LaVolpe
Bolded menu items indicate a shortcut for default menu. Per MSDN: "The default command is invoked when users double-click or select an object and press Enter." In other words, instead of right clicking on something, selecting the bolded popup menu item, the user can simply double click on it. Only 1 submenu item in the popup/context menu should ever be bolded; else you risk confusing your user.
Exactly.
But you have to consider a few things. People who drive using their feet on the steering wheel and hands on the pedals with mirrors rigged to see where they are going have no trouble creating bizarre user interfaces that ignore standards and guidelines. It's the old "I want it this way, screw the users who will be massively confused" approach to software development.
It's similar to the old "I want the Enter key to do what the Tab keys does" sort of thing.
If you have no clue how Windows UIs work you tend to get... "creative."
-
Nov 24th, 2015, 11:06 AM
#9
Re: Menu Item Question
Originally Posted by LaVolpe
@JM. Bolded menu items indicate a shortcut for default menu. Per MSDN: "The default command is invoked when users double-click or select an object and press Enter." In other words, instead of right clicking on something, selecting the bolded popup menu item, the user can simply double click on it. Only 1 submenu item in the popup/context menu should ever be bolded; else you risk confusing your user.
If this is indeed a context menu scenario you are describing, my first reply should work.
P.S. non-visible menus/menuitems are created on demand in VB when you display them.
This is what I am doing:
If you notice that when you right drag drop an item onto Windows Explorer it shows a popup menu displaying three choices:
Copy Here
Move Here
Cancel
Move Here is bold. If you don't select anything from the menu then no action is performed so I don't understand how it is the default. I know if you left drag and drop the item is moved to the target but not right drag - please explain you comment
Also please explain:
P.S. non-visible menus/menuitems are created on demand in VB when you display them
You know you can make them non-visible at design time
Last edited by jmsrickland; Nov 24th, 2015 at 11:16 AM.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Nov 24th, 2015, 11:11 AM
#10
Re: Menu Item Question
"But you have to consider a few things. People who drive using their feet on the steering wheel and hands on the pedals with mirrors rigged to see where they are going have no trouble creating bizarre user interfaces that ignore standards and guidelines. It's the old "I want it this way, screw the users who will be massively confused" approach to software development."
Sounds like a government application I've been testing!!!!!
-
Nov 24th, 2015, 11:12 AM
#11
Re: Menu Item Question
Originally Posted by dilettante
If you have no clue how Windows UIs work you tend to get... "creative."
Or if you are the kind of individual who is more interested in the UI than the code behind it.
I've seen many a web developer trying to scratch that itch.
Burn the land and boil the sea
You can't take the sky from me
~T
-
Nov 24th, 2015, 11:14 AM
#12
Re: Menu Item Question
Move Here is Bold. If you don't select anything from the menu then no action is performed so I don't understand how it is the default - please explain
You never described how you were using the popup menu, didn't give us any context.
So, if no action occurs without clicking on a menu item, then I don't really understand a need to bold something.
As far as default menu commands go, a simple scenario is one like this:
1) You have an icon that can perform multiple actions based on a popup/context menu
2) The most common menu option would be a 'Copy' command
3) Instead of forcing user to right click & select 'Copy', you can add code behind the icon control to copy when double clicked
4) When right clicked, you'd display all the options available, but include 'Copy' as bold so users know that double click = 'Copy'
-
Nov 24th, 2015, 11:20 AM
#13
Re: Menu Item Question
Originally Posted by LaVolpe
You never described how you were using the popup menu, didn't give us any context.
So, if no action occurs without clicking on a menu item, then I don't really understand a need to bold something.
As far as default menu commands go, a simple scenario is one like this:
1) You have an icon that can perform multiple actions based on a popup/context menu
2) The most common menu option would be a 'Copy' command
3) Instead of forcing user to right click & select 'Copy', you can add code behind the icon control to copy when double clicked
4) When right clicked, you'd display all the options available, but include 'Copy' as bold so users know that double click = 'Copy'
I don't either but it is what Explorer does so I'm doing the same thing
What are you saying double click? Double click on what? Double click on the menu selection? I don't understand
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Nov 24th, 2015, 11:26 AM
#14
Re: Menu Item Question
I don't either but it is what Explorer does so I'm doing the same thing
Ah, I see. Yes, Windows Explorer doesn't make sense in that respect does it, other than letting you know what would've happened if your left-dragged vs. right-dragged? Now if after you showed the context menu, you actually highlighted the menu item & set focus to the menu so the user could simply hit the enter key -- that'd make more sense (but maybe dangerous for users?).
-
Nov 24th, 2015, 02:07 PM
#15
Re: Menu Item Question
Explorer lets you know the default because that's useful information. Contrary to what jms says, there are many circumstances where copy or create shortcut is bolded on a right drag menu instead of move, with corresponding different default left drag behavior. If I'm not sure what's going to happen with left drags, I always check which item is bolded on the right click menu first.
-
Nov 24th, 2015, 02:16 PM
#16
Re: Menu Item Question
If I'm not sure what's going to happen with left drags
If most apps do what Explorer does, sure seems that right-dragging will highlight which option would occur if you left dragged. And it appears so. Is this really useful information for the user? Six of one, half-dozen of the other. If you consistently right-dragged files from one folder to another folder on different drives, you'd get the 'Copy' option bolded. Well, if you adjusted your behavior, knowing that 'Copy' always occurs, then you might start left-dragging & that's where the danger occurs: behavior modification leaning towards quick & easy. Now that one is in that mode, they left drag between folders on the same drive. Now the file was moved vs copied & hopefully user realized it.
But in any case really. The default option, relating to menus, is really app-specific. If one is completely familiar with the different options and how/when they apply, they can use the shortcut (left-drag, double click, whatever) vs displaying a context menu & selecting from that. If one wants to replicate Explorer behavior for their app, then so be it, but is that behavior consistent across all operating systems? If not, other decisions should be made. Better, IMO, to define your app's own behavior (even if it duplicates some other app's behavior by design or accident)
P.S. @JM. Just to be sure, you do realize that when dragging (right or left), the default (bolded) option can change depending on the source & destination and/or if the control/shift key is held down.
Last edited by LaVolpe; Nov 24th, 2015 at 02:24 PM.
-
Nov 24th, 2015, 04:58 PM
#17
Re: Menu Item Question
Originally Posted by LaVolpe
P.S. @JM. Just to be sure, you do realize that when dragging (right or left), the default (bolded) option can change depending on the source & destination and/or if the control/shift key is held down.
Yes, I am aware of this.
All I am doing is to make my app have the look and feel of Windows Explorer so if WE does this and does that then that is how it will be with my app.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Nov 24th, 2015, 08:22 PM
#18
Re: Menu Item Question
So much work trying to simulate the look and feel of Explorer instead of just actually using Explorer... there's just no way with all the threads you've posted that your code isn't way more complex, lengthy, unstable, etc, than just the 2 API calls you were having trouble with.
Last edited by fafalone; Nov 24th, 2015 at 08:29 PM.
-
Nov 24th, 2015, 09:17 PM
#19
Re: Menu Item Question
Oh, well, what can I say.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Nov 25th, 2015, 12:49 PM
#20
Re: Menu Item Question
Originally Posted by LaVolpe
P.S. @JM. Just to be sure, you do realize that when dragging (right or left), the default (bolded) option can change depending on the source & destination and/or if the control/shift key is held down.
Here's what I came up with by trying all the combinations. I really don't see the point to this at all:
Code:
Same Dives Different Drives
Action Effects Effects
Left drag Move Copy
Left drag+Alt Copy Copy
Left drag+Ctrl Copy Copy
Left drag+Ctrl+Alt Move Copy
Left drag+Shift Move Move
Left drag+Ctrl+Shift Copy Copy
Right drag Menu: Copy Move Cancel Menu: Copy Move Cancel
Right drag+Alt No action No action
Right drag+Ctrl Menu: Copy Move Cancel Menu: Copy Move Cancel
Right drag+Ctrl+Alt No action No action
Right drag+Shift Menu: Copy Move Cancel Menu: Copy Move Cancel
Right drag+Ctrl+Shift Menu: Copy Move Cancel Menu: Copy Move Cancel
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
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
|