-
December 3rd, 2010, 12:25 AM
#1
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
-
December 3rd, 2010, 12:35 AM
#2
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.
-
December 3rd, 2010, 04:11 AM
#3
Re: radiobutton' : 'operator =' function is unavailable
Originally Posted by sujithsv
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
-
December 3rd, 2010, 09:19 AM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|