CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2002
    Location
    Huntsville, AL
    Posts
    54

    VC Grouping Radio Buttons - No Longer Int

    I've upgraded to the latest service pack of NET.

    In VC6, You identified the FIRST radio button as GROUP and the the Class editor would make the variable name of the group a type int with initialization of -1.

    In NET, it does not appear to react to the GROUP flag being set since it defines the variable as bool type and set the initialization to FALSE instead of -1.

    Is this a problem or am I missing something? I have been hand fixing these since I switched to NET.

  2. #2
    Join Date
    Apr 2004
    Posts
    4

    Radio button groups in VC++.NET

    To add a radio button group in VC++.NET you add your radio buttons as normal (have them in tab order for ease of use).

    Change the 1st radio button of the group to have the GROUP property to True.

    Right-click the first radio button control in the tab order (the dominant control and the one with the Group property set to True).

    Choose Add Variable from the shortcut menu (right click).

    In the Add Member Variable wizard, select the Control variable check box, then select the Value from the Category drop down box.

    In the Variable name box, type a name for the new member variable.

    In the Variable type list box type int (This will give a default of Bool).

    You can now modify your code to specify which radio button should appear selected. For example, m_radioBox1 = 0; selects the first radio button in the group.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured