Solved

Getting default a Cdialog BackGround Color

Posted on 1998-02-15
2
878 Views
Last Modified: 2013-11-20
Hi ...
 
My question is quite easy

from a CDialog, i draw a rect using dc.Rectangle(&rect) , it draws it to me in white in my dialog box , it's okay
But i dunno how to delete it,
so , how could i get the backgorund color of my Cdialog
to rewrite a REct of same size at same location x,y, but not in white , but with the background color of my Cdialog ?

Or maybe is there any other way to delete my Drawed Rectangle ?
Thanx for all
0
Comment
Question by:SkizoWalker
2 Comments
 
LVL 11

Accepted Solution

by:
mikeblas earned 50 total points
ID: 1316216
You can get the default color for the background of a dialog by calling GetSysColor() with the COLOR_WINDOW parameter.  That'll return you the COLORREF that you can use to create a brush. Create and select that brush before your call to Rectangle(), and your rectangle will have the correct color.

If you want a rectangle with nothing colored inside of it, you should draw a rectangle yourself by calling CDC::MoveTo() and CDC::LineTo(), or by calling CDC::Polyline or CDC::Polygon().

I don't understand your comment about "a way to delete my drawed rectangle".  If you don't want a rectangle, why did you draw it?

.B ekiM

0
 

Author Comment

by:SkizoWalker
ID: 1316217
Okay thanx for this little teach ;)

>I don't understand your comment about "a way to delete my drawed rectangle". If you don't want a rectangle, why did you draw it?

I need my rectangle that's why i draw it, i was thinking another way of deleting it my drawed rectangle without filling it with background color, you see ? anyway , thanx for fast help

Greetings . . SkiZo / MoDEL

http://model.tekno.org      3DReal Time Visual FX Engeniring

0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

803 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