Solved

Border Painting in MFC

Posted on 1997-01-18
1
1,517 Views
Last Modified: 2013-12-03
I need to control the painting of the border of CWnd derived classes. I can do this for some windows by handling the WM_NCPAINT message to over-draw the existing border. However, it other classes derived from CWnd, such as CTabCtrl and CEdit, the border is drawn after recieving the WM_NCPAINT message and I have not been able to prevent the border from being drawn. In general, I wish to control the painting of borders in all types of windows. How can I do this?
0
Comment
Question by:cmahle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
gtschech earned 50 total points
ID: 1298607
A way to achieve this should be to create the windows without the WS_BORDER style (modify the style parameter in the PreCreateWindow() method),
and then reacting to the WM_NCCALCSIZE message (OnNcCalcsize()) with modification of the client area; see the MSDev explanation of OnNcCalcSize(). There is no other possibility to prevent en edit control from drawing it's border.

There may even be no chance to modify a combo box button, because this is always drawn.

I have another idea, but maybe try this first.
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question