-
October 9th, 2019, 02:01 AM
#61
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Originally Posted by Sparsh_21j
Yes Arjay it sets the button text to OKAY,even button font is also getting bold if i use CFont concept,even position of button is also changing if i use Movewindow..Only thing and most painful for me button Color which is not changing.
If the text is getting set with SetDlgItemText with id IDOK, but you can't change the background color withe the DDX mapped m_ok variable, it means the DDX mapping isn't working. Are you sure IDOK is a valid id for the property sheet ok button?
-
October 9th, 2019, 02:45 AM
#62
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Originally Posted by Arjay
... Are you sure IDOK is a valid id for the property sheet ok button?
Well, the standard IDs in property sheet are:
IDOK, IDAPPLY, IDCANCEL, IDHELP.
Victor Nijegorodov
-
October 9th, 2019, 07:53 AM
#63
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Originally Posted by Arjay
If the text is getting set with SetDlgItemText with id IDOK, but you can't change the background color withe the DDX mapped m_ok variable, it means the DDX mapping isn't working. Are you sure IDOK is a valid id for the property sheet ok button?
IDOK is right and worked for me. I asked the OP to check if m_ok had a valid m_hWnd. No response to that one yet.
-
October 9th, 2019, 10:42 AM
#64
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Originally Posted by VictorN
Well, the standard IDs in property sheet are:
IDOK, IDAPPLY, IDCANCEL, IDHELP.
Well, it's been 20 years so I forget...
-
October 9th, 2019, 10:21 PM
#65
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
{hwnd=0x000000000a3 {unused=???}}
-
October 10th, 2019, 01:24 AM
#66
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Victor Nijegorodov
-
October 10th, 2019, 07:12 AM
#67
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Originally Posted by Sparsh_21j
{hwnd=0x000000000a3 {unused=???}}
If this is really your code
Code:
BOOL MyPropertysheet:: OnInitDialog()
{
BOOL bResult = CPropertySheet:: OnInitDialog();
UpdateData(FALSE);
m_ok.SetFaceColor(RGB(255,102,0);
SetDlgItemText(IDOK,("OKAY"));
return bResult;
}
you need to step into UpdateData and find out why it isn't working.
Does SetDlgItemText work?
-
October 11th, 2019, 05:25 AM
#68
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
SetDlgItemText works if UpdataData(FALSE) is not used.As soon as i use UpdateData(FALSE) before SetFaceColor than button becomes invisible(already told)
-
October 11th, 2019, 06:22 AM
#69
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Originally Posted by GCDEF
If this is really your code
Code:
BOOL MyPropertysheet:: OnInitDialog()
{
BOOL bResult = CPropertySheet:: OnInitDialog();
UpdateData(FALSE);
m_ok.SetFaceColor(RGB(255,102,0);
SetDlgItemText(IDOK,("OKAY"));
return bResult;
}
you need to step into UpdateData and find out why it isn't working.
Does SetDlgItemText work?
Asked in post #32 and answered in #33.
-
October 11th, 2019, 07:20 AM
#70
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Originally Posted by Beginner_MFC
SetDlgItemText works if UpdataData(FALSE) is not used.As soon as i use UpdateData(FALSE) before SetFaceColor than button becomes invisible(already told)
Could you post the complete test project that reproduces such a strange behavior?
So we would try to test it...
Victor Nijegorodov
-
October 11th, 2019, 10:37 AM
#71
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
I'm saying time to do some stepping to figure out what's happening
-
October 11th, 2019, 10:54 AM
#72
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Originally Posted by GCDEF
I'm saying time to do some stepping to figure out what's happening
The time to do that is before posting 50 questions to a forum.
-
October 11th, 2019, 11:17 AM
#73
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Originally Posted by Arjay
The time to do that is before posting 50 questions to a forum.
Victor Nijegorodov
-
October 16th, 2019, 07:54 AM
#74
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
I did debug but not able to get anything on UpdateData() means no success!!
-
October 16th, 2019, 08:05 AM
#75
Re: Changing background Color of standard buttons (ok,cancel,help) of Cpropertysheet
Originally Posted by Beginner_MFC
I did debug but not able to get anything on UpdateData() means no success!!
Did UpdateData get called?
Did m_ok have a valid m_hWnd after the call?
Did you step into the DDX call to see why it was failing if it was?
Did m_ok have a valid m_hWnd after UpdateData and when you called SetFaceColor?
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
|