NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

MenuItem.RadioCheck

Gets or sets a value that indicates whether the menu item, if checked, displays a radio-button mark instead of a check mark.

[Visual Basic]
Public Property RadioCheck As Boolean
[C#]
public bool RadioCheck {get; set;}
[C++]
public: __property bool get_RadioCheck();
public: __property void set_RadioCheck(bool);
[JScript]
public function get RadioCheck() : Boolean;
public function set RadioCheck(Boolean);

Property Value

true if a radio-button mark is to be used instead of a check mark; false if the standard check mark is to be displayed when the menu item is checked. The default is false.

Remarks

Check marks do not neccessarily imply a mutually exclusive state for a group of menu items. You can use this property to indicate to the user that the check mark of a menu item is mutually exclusive.

Example [Visual Basic]

The following example uses the Checked property to change the state of an application. In the example, a group of menu items are provided that are used to specify the color for the text in an TextBox control. In the example, the event handler provided is used by the System.WinForms.MenuItem.Click event of the three menu items. Each menu item specifies a color, menuRed, menuGreen, or menuBlue. The event handler determines which menu item was clicked, places a checkmark to the selected menu item, and changes the text color of the form's TextBox control. The example also uses the RadioCheck property to demonstrate how a radio-button check is used to show menu items that are mutually exclusive.

[Visual Basic]

'This method is called from the constructor of the form to setup 
the menu items.
Public Sub ConfigureMyMenus()
   'Set all of these menu items to Radio-Button check marks so the user can see that only one color can be selected at a time.
   menuRed.RadioCheck = True
   menuBlue.RadioCheck = True
   menuGreen.RadioCheck = True
End Sub
'The following event handler would be connected to three menu items.
Public Sub MyMenuClick(ByVal sender as System.Object, ByVal e as System.EventArgs)
   if sender Is menuBlue Then
      ' Set the checkmark for the menuBlue menu item.
      menuBlue.Checked = True
      ' Uncheck the menuRed and menuGreen menu items.
      menuRed.Checked = False
      menuGreen.Checked = False
      ' Set the color of the text in the Edit control to Blue.
      Set Edit1.ForeColor = System.Drawing.Color.Blue
   Else If sender Is Red Then
      ' Set the checkmark for the menuRed menu item.
      menuRed.Checked = True
      ' Uncheck the menuBlue and menuGreen menu items.
      menuBlue.Checked = False
      menuGreen.Checked = False
      ' Set the color of the text in the Edit control to Red.
      Set Edit1.ForeColor = System.Drawing.Color.Red
   Else
      ' Set the checkmark for the menuGreen menu item.
      menuGreen.Checked = True
      ' Uncheck the menuRed and menuGreen menu items.
      menuBlue.Checked = False
      menuRed.Checked = False
      ' Set the color of the text in the Edit control to Blue.
      Set Edit1.ForeColor = System.Drawing.Color.Green
   End If
End Sub

See Also

MenuItem Class | MenuItem Members | System.WinForms Namespace