本文介绍了如何删除向导按钮周围的白色边框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我设计了一个属性表,并在表单onpaint()事件中用黑色渐变填充其页脚。当我运行我的应用程序时,我注意到了向导,Back和取消按钮周围的白色边框。我不想在向导按钮周围有白色边框,我们如何删除向导按钮周围的白色边框。 在Sheet的OnPaint()中,我用这种方式用黑色渐变填充页脚。 // CMySheet派生自CPropertySheet。 void CMySheet :: OnPaint() { if(IsIconic()) { CPaintDC dc(this); //绘画的设备上下文 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是页面底部rect CRect rectFooter(Clientrect.top,(Clientrect.bottom - RectDifference),Clientrect.right,Clientrect.b ottom); // 638 // 520 // CRect rectFooter(0,390,640,445); FillGradation(& dc,rectFooter,RGB(150,150,150),RGB(0, 0,0),true); } } } 无效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); } 我在stackoverflow中看到一个类似于我的问题的帖子,但没有可用的解决方案。如果你想要向导按钮应该如何以及他们如何看待你可以看看这个链接。 http://stackoverflow.com/questions/26846259/issue-in-drawing -color-on-propertysheet-footer [ ^ ] 任何人都可以告诉我,如果有办法删除按钮周围的白色边框。 提前致谢 Brahmam 解决方案 这是主题按钮的绘图区域,我认为... 所以你可以尝试实现自己绘制的按钮(以替换给定的控件) ) 或者为非工作表指定的工作表注册窗口类(我从未尝试过):) 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 advanceBrahmam 解决方案 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) :) 这篇关于如何删除向导按钮周围的白色边框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 06-12 09:03