Checkbox?
-
-
Hello, I cant get my checkbox to work. Here is my problem. I need to do this. If the checkbox is check when I check it I need to uncheck the checkbox and if it uncheck when I press it I need to bring up a new dialog window. I cant get this to work.
Are you using MFC?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
Hello, I cant get my checkbox to work. Here is my problem. I need to do this. If the checkbox is check when I check it I need to uncheck the checkbox and if it uncheck when I press it I need to bring up a new dialog window. I cant get this to work.
Larsson wrote:
if it uncheck when I press it I need to bring up a new dialog window
Do you want it to be checked also? If so set the style to
BS_AUTOCHECKBOX
when you create it. Handle theBN_CLICKED
command and useGetCheck()
to see if the button was checked or unchecked.
You may be right
I may be crazy
-- Billy Joel --Within you lies the power for good, use it!!!
-
Are you using MFC?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
Larsson wrote:
if it uncheck when I press it I need to bring up a new dialog window
Do you want it to be checked also? If so set the style to
BS_AUTOCHECKBOX
when you create it. Handle theBN_CLICKED
command and useGetCheck()
to see if the button was checked or unchecked.
You may be right
I may be crazy
-- Billy Joel --Within you lies the power for good, use it!!!
-
Via ClassWizard (Ctrl+W), provide a handler for the
BN_CLICKED
notification message. In it, call the button'sGetCheck()
method to get the checked state of the button.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
Hello, I cant get my checkbox to work. Here is my problem. I need to do this. If the checkbox is check when I check it I need to uncheck the checkbox and if it uncheck when I press it I need to bring up a new dialog window. I cant get this to work.
Use ClassWizard to add a
BOOL
for the checkbox namedm_bCheck
. Double-click on the checkbox to add a handler. Populate the handler with code like the following:void CMFCDialogDlg::OnCheck1()
{
UpdateData(TRUE);
if (m_bCheck)
{
// Show your dialog.
AfxMessageBox(_T("Dialog goes here..."));
}}
Steve
-
Use ClassWizard to add a
BOOL
for the checkbox namedm_bCheck
. Double-click on the checkbox to add a handler. Populate the handler with code like the following:void CMFCDialogDlg::OnCheck1()
{
UpdateData(TRUE);
if (m_bCheck)
{
// Show your dialog.
AfxMessageBox(_T("Dialog goes here..."));
}}
Steve