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

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()

CPaintDC dc(this); // device context for painting

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

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

CPaintDC dc(this);


CRect Clientrect;

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

CRect rectFooter(,(Clientrect.bottom - RectDifference),Clientrect.right,Clientrect.bottom);//638//520
//CRect rectFooter(0,390,640,445);



void CMySheet::OnPaint(CDC* pDC, CRect rc, COLORREF colBegin, COLORREF colEnd, bool bV)
TRIVERTEX av[2] = {rc.left,,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;

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. "[^]"

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

Thanks in advance

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
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