views:

368

answers:

1

I've been investigating the effort needed in getting menu items displayed in bold face - without having to draw the menu myself - and discovered MFS_DEFAULT menu item state after some googling. The MSDN documentation mentions

MFS_DEFAULT
Specifies that the menu item is the default. A menu can contain only one default menu item, which is displayed in bold.

I experimented and it appears that contrary to the documentation, it seems like I'm able to use this flag to display multiple (or possibly all!) menu items in bold face. Does anyone have any experience with this i.e. if there are any pitfalls in having multiple bolded menu items? It does feel like a bit of a hack to get to what I'm trying to achieve and I'm a little worried about unknown side-effects (i.e. having multiple 'default' menu items in a single menu).

EDIT: I should also add that this article claims that the MFS_DEFAULT flag does nothing but displaying the menu item in bold face; still, I'm a little wary of going against the 'official' documentation...

EDIT2: The purpose of this was to tell the user that the menu item in question (i.e. that one that is bolded) can also be invoked by double clicking the control in question (the menu item is part of context menu). When I thought about this problem I didn't consider the fact that - usually - only one command can be associated with the double click event (d'oh!). As such I have accepted zaphod's answer (it doesn't answer this question directly but it did solve my 'problem')

+3  A: 

What are you trying to achieve?

I suspect that the biggest objection to using MFS_DEFAULT for a purpose other than the one for which it was intended is that you're violating a visual convention Microsoft is trying to promulgate about what bolded menu items mean, and how a user (or an assistive program such as a screen reader) should react upon encountering one.

If all you're trying to do is call the user's attention to a few menu items that are of particular interest -- well, that seems a bit strange, but it also seems fairly innocent, and I'd be surprised if it caused you enormous problems down the road. Anything's possible, of course! Still, I'd wonder about what exactly you were up to.

If you're trying to expose part of your program's state by bolding and unbolding menu items -- that seems a little bit unexpected to me, but I'd hate to pass judgement before hearing the specifics.

If you have some other goal in mind -- like maybe you think the default font for menus is ugly and you like it better when everything is bolded -- then the method you've discovered might be expedient, but there might also be a better way to get exactly what you want, which we could discuss in more detail (perhaps in a separate question) if you were willing. I doubt this is the case, but who knows?

zaphod