Click here to Skip to main content
15,884,739 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I had designed a propertysheet and filled its footer with black gradient in the sheet onpaint() event.When I run my application then I noticed a white border around the wizard Back,Next and Cancel buttons.I don't want that white border around the wizard buttons ,how can we remove that white border around the wizard buttons.

In the OnPaint() of the Sheet I am had done in this way to fill the footer with black gradient.

//CMySheet is derived from CPropertySheet.
void CMySheet::OnPaint()
{

if(IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND,reinterpret_cast<wparam>(dc.GetSafeHdc()),0);

int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);

CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1)/2;
int y = (rect.Height() - cyIcon + 1)/2;

}
else
{
CPaintDC dc(this);

UpdateData(false);

CRect Clientrect;
GetClientRect(&Clientrect);

LONG RectDifference = ((Clientrect.bottom - m_PageRectBottom)-2);//m_pageRectBottom is of page bottom rect

CRect rectFooter(Clientrect.top,(Clientrect.bottom - RectDifference),Clientrect.right,Clientrect.bottom);//638//520
//CRect rectFooter(0,390,640,445);
FillGradation(&dc,rectFooter,RGB(150,150,150),RGB(0,0,0),true);

}

}
}

void CMySheet::OnPaint(CDC* pDC, CRect rc, COLORREF colBegin, COLORREF colEnd, bool bV)
{
TRIVERTEX av[2] = {rc.left,rc.top,GetRValue(colBegin) << 8,GetGValue(colBegin) << 8,GetBValue(colBegin) << 8 ,0xff00,
rc.right,rc.bottom,GetRValue(colEnd) << 8 ,GetGValue(colEnd) << 8,GetBValue(colEnd) << 8,0xff00,};

GRADIENT_RECT gr = {0,1};
ULONG ulMode;
if(bV){
ulMode = GRADIENT_FILL_RECT_V;
}
else{
ulMode = GRADIENT_FILL_RECT_H;
}
GradientFill(pDC->GetSafeHdc(),av,2,&gr,1,ulMode);

}
I saw a post in stackoverflow something similar to my problem but no solution is available there .If you want how the wizard button should like and how they are looking at present you can have a look at this link. "http://stackoverflow.com/questions/26846259/issue-in-drawing-color-on-propertysheet-footer[^]"


Can anyone please let me know if there exists a way to remove that white border around the buttons.

Thanks in advance
Brahmam
Posted

1 solution

It is a drawing area of the themed buttons, I think...

So you could try to implement your own-drawn buttons (to replace the given controls)
or to register a window class for your sheet specified by a non-sheet-brush (I have never tried it) :)
 
Share this answer
 
Comments
RajaPratap 19-Nov-14 21:48pm    
But in owner draw buttons I am not getting the mouse hover focus on the button .Only I am able to set the rectangular selection to that button.I used CMFCButton class to create buttons and hide the wizard buttons.By default CMFCButton has owner drawn style.Can you please provide me some sample if possible.

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