-
June 2nd, 2017, 11:17 PM
#1
how to change the color of property sheet wizard button in VC++
Hi All,
I want to change the color of property sheet wizard button. The wizard has ID_WIZNEXT, ID_WIZFINISH and other default button. the button label and position is changed. i want to change the color of this default button.
Code:
class CDiskSanPropertySheet : public CPropertySheet
{
}
BOOL CDiskSanPropertySheet::OnInitDialog()
{
CPropertySheet::OnInitDialog();
CButton *tmpButtonNext = reinterpret_cast<CButton *>(GetDlgItem(ID_WIZNEXT));
CButton *tmpButtonFinish = reinterpret_cast<CButton *>(GetDlgItem(ID_WIZFINISH));
CButton *tmpButtonBack = reinterpret_cast<CButton *>(GetDlgItem(ID_WIZBACK));
CButton *tmpButtonCancel = reinterpret_cast<CButton *>(GetDlgItem(IDCANCEL));
buttonString.LoadStringW(IDS_TEXT_BUTTON_NEXT);
tmpButtonNext->SetWindowTextW(buttonString.GetBuffer());
buttonString.ReleaseBuffer();
LONG rightPos, nextRightPos;
//inc. to 1.7 for greek issue
MoveButton(tmpButtonCancel,shiftFactorX, 1.7,NULL,tmpButtonNext,&nextRightPos);
MoveButton(tmpButtonFinish,shiftFactorX, 1.7,NULL,NULL,NULL);
rightPos = nextRightPos;
MoveButton(tmpButtonNext,shiftFactorX, 1.7,&rightPos,tmpButtonBack,&nextRightPos);
rightPos = nextRightPos;
MoveButton(tmpButtonBack,shiftFactorX, 1.7,&rightPos,NULL,NULL);
}
HBRUSH CDiskSanPropertySheet::OnCtlColor(CDC* pDC, CWnd *pWnd, UINT nCtlColor)
{
HBRUSH hbr = CPropertySheet::OnCtlColor(pDC,pWnd, nCtlColor);
COLORREF myColor = RGB(250,250,250);
//COLORREF myColor = RGB(0, 0, 255);
TCHAR classname[MAX_PATH];
if(::GetClassName(pWnd->m_hWnd, classname, MAX_PATH) == 0)
return hbr;
if(_tcsicmp(classname, _T("EDIT")) == 0)
if(_tcsicmp(classname, _T("LISTBOX")) == 0)
return hbr;
if(_tcsicmp(classname, WC_TREEVIEW) == 0)
return hbr;
pDC->SetTextColor((myColor));
if ((HBRUSH)brush == NULL)
brush.CreateSolidBrush((myColor));
return (HBRUSH) brush;
}
I want to change the color of the above button. Please help me to resolve this.
Regards,
Rani
Last edited by 2kaud; June 3rd, 2017 at 02:33 AM.
Reason: Added code tags
-
June 3rd, 2017, 08:51 AM
#2
Re: how to change the color of property sheet wizard button in VC++
Originally Posted by smrani
Hi All,
I want to change the color of property sheet wizard button. The wizard has ID_WIZNEXT, ID_WIZFINISH and other default button. the button label and position is changed. i want to change the color of this default button.
...
I want to change the color of the above button. Please help me to resolve this.
i
Just have a look at what the other guys did in a similar situation:
http://www.codeguru.com/cpp/controls...red-Button.htm
http://forums.codeguru.com/showthrea...lor-of-CButton
https://social.msdn.microsoft.com/Fo...orum=vcgeneral
https://social.msdn.microsoft.com/Fo...orum=vcgeneral
...
https://www.google.ch/search?q=chang...hrome&ie=UTF-8
Victor Nijegorodov
-
June 4th, 2017, 03:19 PM
#3
Re: how to change the color of property sheet wizard button in VC++
I have no idea how this can be achieved, however the right cast would be static_cast instead of reinterpret_cast.
Just FYI.
Tags for this Thread
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
|