CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2010
    Posts
    6

    radiobutton' : 'operator =' function is unavailable

    To make a check box/radio box to be transparent ,i use transparent radio button subclass that derived from the CButton.The method i followed was taken from the code guru site.It helps to make the check box/radio box button to be transparent.

    But i need to check the state of the Check Box?So that i use BOOL function

    for example IDC_CHECK is the id attached to check box

    DDX_Control(pDX, IDC_CHECK, m_check); //used to declare a variable

    radiobutton m_check; //declaration


    while i use to check the status

    m_check ==TRUE

    then the error showing

    radiobutton' : 'operator ==' function is unavailable

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: radiobutton' : 'operator =' function is unavailable

    Use the class wizard or the "Add variable" feature to create the BOOL variable for you.

    DDX_CONTROL is the wrong macro to wire up a bool variable.

  3. #3
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,398

    Re: radiobutton' : 'operator =' function is unavailable

    Quote Originally Posted by sujithsv View Post
    T
    Code:
     DDX_Control(pDX, IDC_CHECK, m_check);  //used to declare a variable
    
     radiobutton   m_check; //declaration
    What is radiobutton? Is it a class derived from CButton?
    Then use CButton::GetCheck() to obtain the state of it (BS_CHECKED or BS_UNCHECKED)
    Victor Nijegorodov

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: radiobutton' : 'operator =' function is unavailable

    I was being brain dead in my earlier response - BOOL is not to be used for radio buttons.

    To get the selected values from a radio button using ddx, you set the tab order of the radio buttons to a sequential order, set the first radio button in the series to WS_GROUP style (Group = true).

    Next you create an INT variable for the first radio button.

    The INT variable will return the 0 based index for the selected radio button. To set the selected radio button, just set the int variiable and call UpdateData( FALSE ).

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