Solved

Border Painting in MFC

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 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

18 Experts available now in Live!

Get 1:1 Help Now