-
March 16th, 2014, 07:30 AM
#1
[RESOLVED] CButton SetCheck problem with Unchecking
One small problem is heating me up so finally posted here to get the solution. As the thread name, Im trying to Uncheck a Checkbox control with following code.
Code:
else if((point.x >= (rcRememPass.left - 4) && point.x <= rcRememPass.right) && (point.y >= rcRememPass.top && point.y <= rcRememPass.bottom))
{
if(m_CheckBoxRemem.GetState() == BST_CHECKED)
m_CheckBoxRemem.SetCheck(0);
else
m_CheckBoxRemem.SetCheck(1);
}
Above code snippet is from OnLButtonUp(). Whereas else part working good why the if part is failing to uncheck the box ?. Any ideas ?
◄◄ hypheni ►►
-
March 17th, 2014, 08:09 AM
#2
Re: CButton SetCheck problem with Unchecking
Originally Posted by hypheni
One small problem is heating me up so finally posted here to get the solution. As the thread name, Im trying to Uncheck a Checkbox control with following code.
Code:
else if((point.x >= (rcRememPass.left - 4) && point.x <= rcRememPass.right) && (point.y >= rcRememPass.top && point.y <= rcRememPass.bottom))
{
if(m_CheckBoxRemem.GetState() == BST_CHECKED)
m_CheckBoxRemem.SetCheck(0);
else
m_CheckBoxRemem.SetCheck(1);
}
Above code snippet is from OnLButtonUp(). Whereas else part working good why the if part is failing to uncheck the box ?. Any ideas ?
Probably should be using GetCheck() not GetState()
-
March 17th, 2014, 08:09 AM
#3
Re: CButton SetCheck problem with Unchecking
Unless I am mistaken, it should be something like:
Code:
if(m_CheckBoxRemem.GetState() & BST_CHECKED)
Nobody cares how it works as long as it works
-
March 17th, 2014, 11:53 AM
#4
Re: CButton SetCheck problem with Unchecking
Well, there was some focusing issue I guess. Still I replaced my code with GetCheck() instead of GetState().
◄◄ hypheni ►►
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
|