?
Solved

Getting default a Cdialog BackGround Color

Posted on 1998-02-15
2
Medium Priority
?
911 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses
Course of the Month14 days, 20 hours left to enroll

770 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