Dialog problem!
-
I have 2 dialog, first dialog I have a checkbox. If you click on that dialog box a new dialog is show and I have a button there and when that button is pressed on I need to end the dialog and the checkbox on the first dialog should not be checked. So how can I do that? Sorry for the bad english.
-
I have 2 dialog, first dialog I have a checkbox. If you click on that dialog box a new dialog is show and I have a button there and when that button is pressed on I need to end the dialog and the checkbox on the first dialog should not be checked. So how can I do that? Sorry for the bad english.
Which part do you have so far and which part are you having trouble with? Mark
-
I have 2 dialog, first dialog I have a checkbox. If you click on that dialog box a new dialog is show and I have a button there and when that button is pressed on I need to end the dialog and the checkbox on the first dialog should not be checked. So how can I do that? Sorry for the bad english.
Larsson wrote:
...when that button is pressed on I need to end the dialog...
Just call
EndDialog()
like would happen if you clicked the OK button.Larsson wrote:
...and the checkbox on the first dialog should not be checked.
Just uncheck it with
SetCheck()
.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
I have 2 dialog, first dialog I have a checkbox. If you click on that dialog box a new dialog is show and I have a button there and when that button is pressed on I need to end the dialog and the checkbox on the first dialog should not be checked. So how can I do that? Sorry for the bad english.
ok. I think that you are ok with the first part. in the second part, you have two approaches: in the 2nd dlg button write code that looks like this: void CDialog2::OnButton() { (CDialog1 pDlg*)=GetParent(); pDlg->m_ctlCheck1.SetCheck(FALSE); CDialog::OnOK(); } or after exiting the 2nd dialog set a flag and check it in the first diaog regards, Mohammad Gdeisat
-
Larsson wrote:
...when that button is pressed on I need to end the dialog...
Just call
EndDialog()
like would happen if you clicked the OK button.Larsson wrote:
...and the checkbox on the first dialog should not be checked.
Just uncheck it with
SetCheck()
.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
ok. I think that you are ok with the first part. in the second part, you have two approaches: in the 2nd dlg button write code that looks like this: void CDialog2::OnButton() { (CDialog1 pDlg*)=GetParent(); pDlg->m_ctlCheck1.SetCheck(FALSE); CDialog::OnOK(); } or after exiting the 2nd dialog set a flag and check it in the first diaog regards, Mohammad Gdeisat
-
ok. I think that you are ok with the first part. in the second part, you have two approaches: in the 2nd dlg button write code that looks like this: void CDialog2::OnButton() { (CDialog1 pDlg*)=GetParent(); pDlg->m_ctlCheck1.SetCheck(FALSE); CDialog::OnOK(); } or after exiting the 2nd dialog set a flag and check it in the first diaog regards, Mohammad Gdeisat
-
Well this is what I get on (CDialog1 pDlg*)=GetParent(); error C2146: syntax error : missing ')' before identifier 'pDlg'
Larsson wrote:
Well this is what I get on (CDialog1 pDlg*)=GetParent();
Come on ! what you are trying to do ? I think,
CDialog1* pDlg=(CDialog1*)GetParent();
Prasad Notifier using ATL | Operator new[],delete[][^]
-
:confused: what problems with david crow answer
WhiteSky
-
ok. I think that you are ok with the first part. in the second part, you have two approaches: in the 2nd dlg button write code that looks like this: void CDialog2::OnButton() { (CDialog1 pDlg*)=GetParent(); pDlg->m_ctlCheck1.SetCheck(FALSE); CDialog::OnOK(); } or after exiting the 2nd dialog set a flag and check it in the first diaog regards, Mohammad Gdeisat
amjadamq wrote:
(CDialog1 pDlg*)=GetParent(); pDlg->m_ctlCheck1.SetCheck(FALSE);
Which totally ties the two dialogs together. Not a good design. The preferred solution would be for the second dialog to simply post a message to the firt dialog. In addition,
SetCheck()
does not take aBOOL
argument. It's only by coincidence thatFALSE
and "unchecked" resolve to 0.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb