?
Solved

Border Painting in MFC

Posted on 1997-01-18
1
Medium Priority
?
1,529 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 100 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
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…
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

777 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