Solved

Border Painting in MFC

Posted on 1997-01-18
1
1,493 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
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…

911 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now