[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 940
  • Last Modified:

Getting default a Cdialog BackGround Color

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
SkizoWalker
Asked:
SkizoWalker
1 Solution
 
mikeblasCommented:
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
 
SkizoWalkerAuthor Commented:
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

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now