Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I wrote:

void CMFCApplication7Dlg::OnBnClickedCheck2()
{
	if ((check1.IsDlgButtonChecked==true) || (check3.IsDlgButtonChecked==true))
		text_check.SetWindowText(_T("check_multipli"));// TODO: Add your control notification handler code here
	else
		text_check.SetWindowText(_T("check2"));
}


What I have tried:

text_check must write "check:multipli" if other checkbox are checked but it doesn't work..I don't understand, it writes only check2
Posted
Updated 16-Sep-19 21:54pm

1 solution

Look at the definition of IsDlgButtonChecked function (winuser.h) | Microsoft Docs[^] - it doesn't return a Boolean value, it returns a tristate value:
Quote:
BST_CHECKED          The button is checked.
BST_INDETERMINATE    The button is in an indeterminate state (applies only if the button
                     has the BS_3STATE or BS_AUTO3STATE style).
BST_UNCHECKED        The button is not checked.
 
Share this answer
 
v2
Comments
Member 14594285 17-Sep-19 3:56am    
i WROTE:
if ((check1.IsDlgButtonChecked==BST_CHECKED) || (check3.IsDlgButtonChecked==BST_CHECKED))
text_check.SetWindowText(_T("check_multipli"));// TODO: Add your control notification handler code here
else
text_check.SetWindowText(_T("check2"));
}

but it's the same thing
Member 14594285 17-Sep-19 4:33am    
I solved, I used:
CButton *m_ctlCheck = (CButton*)GetDlgItem(IDC_CHECK1);

but I don't understand whats GetDlgItem do
Rick York 17-Sep-19 11:39am    
GetDlgItem returns a handle to a control in a dialog.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900