How do menu list with one check

  • Thread starter Thread starter VB Programmer
  • Start date Start date
V

VB Programmer

How do I create a submenu so that I can only check ONE of the values?

Example:
Menu
--> Color SubMenu
--> Red Value 1
--> Yellow Value 2
--> Green Value 3

Thanks....
 
VB said:
How do I create a submenu so that I can only check ONE of the values?

Example:
Menu
--> Color SubMenu
--> Red Value 1
--> Yellow Value 2
--> Green Value 3

Thanks....

You have to unclick the other items yourself once on is selected.

Chris
 
I Don't Like Spam said:
You have to unclick the other items yourself once on is selected.

You can simplify this by storing the selected option in a private variable
of type 'MenuItem', for example, then uncheck the previously checked item if
another item is clicked and store the newly checked item in the variable.
 
Thanks, as usual!!! :)

Herfried K. Wagner said:
You can simplify this by storing the selected option in a private variable
of type 'MenuItem', for example, then uncheck the previously checked item
if another item is clicked and store the newly checked item in the
variable.
 
Wasn't this feature built into versions of VB previous to VS.NET 05? I seem
to remember the ability to indicate that a particular set of menu options
was mutually exclusive i.e. a dot would appear next to the single item
selected.

I can live with the fact that I now have to code something that used to be
done with setting control properties, but what irks me is that the visual
interface is no longer consistent. Checks are for non-mutually exclusive
options. Dots are for mutually exclusive options. This used to be true
outside and inside a menu. But with the apparent removal of this feature,
the interface standard is no longer uniformly applied.

Using the example below, in VS.NET 05, if I see a check next to Yellow, I
don't automatically know that I'm only allowed to select one option.
Depending on the application, it may not be intuitive that you can't select
any combination of the options.

Yeah, I guess I could always write my own control, but that's not the point.
It seems like MS has abandoned applying one of the most fundamental GUI
principles when it comes to the Menu. Am I the only one bothered by this?

Mitchell S. Honnert
www.UltraID3Lib.com
 
Mitchell said:
Wasn't this feature built into versions of VB previous to VS.NET 05? I seem
to remember the ability to indicate that a particular set of menu options
was mutually exclusive i.e. a dot would appear next to the single item
selected.

For a moment I thought you had just made this up :) But I checked the
the excerpt from 'The Windows User Experience', as found in the MSDN
Library October 2001, and indeed it is specified that you can have
option-group-like menu items. Can't think of anywhere I've ever seen
one. *However* - I don't recall ever being able to create these
directly in VB, and indeed there's no support for this concept in the
VB6 Menu Editor. So I don't know if you ever could in VB.

However (again), I did find in the .NET Framework the
MenuItem.RadioCheck property, which tells a menu item to display a
radio button (not a check mark) in response to the value of the Checked
property. This (combines with the manual exclusivity coding) gives the
behaviour you seek.
 
VB said:
How do I create a submenu so that I can only check ONE of the values?

Example:
Menu
--> Color SubMenu
--> Red Value 1
--> Yellow Value 2
--> Green Value 3

Echoing my post elsethread, in addition to the other replies, note that
you can set MenuItem.RadioChecked to make the menu items display a dot
rather than a tick mark.
 
Can't think of anywhere I've ever seen one.
You can find an example of the "radio menu item" in Outlook Express (which,
not too coincidentally, I'm using right now as my newsreader.)

View
Current View
Show All Message
Hide Read Messages
Show Downloaded Messages
Hide Read or Ignored Message
However (again), I did find in the .NET Framework the MenuItem.RadioCheck
property, which tells a menu item to display a radio button (not a check
mark)
in response to the value of the Checked property.
A ha! But I'm not using the superseded MenuItem. I'm using the new
ToolStripMenuItem.

From the Help entry on MenuItem...

"Represents an individual item that is displayed within a MainMenu or
ContextMenu. Although ToolStripMenuItem replaces and adds functionality to
the MenuItem control of previous versions, MenuItem is retained for both
backward compatibility and future use if you choose."

So, it still appears that if you want to use the "latest and greatest" menu
controls in VS.NET, you lose the ability to display a check without
overriding the control.

Incidentally, if you look in the Outlook 2003 (and probably other MS Office
03 apps), you see that the View \ Arrange By menu items only use checks even
though they are mutually exclusive. So, if we're supposed to look towards
MS's own products as guidance for GUI design, it truly does appear as if
they've abandoned the principle.

Bummer.

- Mitchell S. Honnert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top