[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Getting default a Cdialog BackGround Color

Posted on 1998-02-15
2
Medium Priority
?
922 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
[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
2 Comments
 
LVL 11

Accepted Solution

by:
mikeblas earned 150 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

650 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