Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drawing in a CStatic

Status
Not open for further replies.

SebastianStricker

Programmer
Aug 28, 2003
10
0
0
DE
Hi guys,

I want to create a CStatic in a dialog form. This CStatic should only display a given COLORREF in a small rectangle.

I tried to create it with SS_SIMPLE and retrieved the CDC* of the CStatic with GetDC() but I'm not able to draw on this DC (I don't see anything).

Can anyone help me? How can I set the color of the CStatic?

Thanks, Sebastian.
 
>> and retrieved the CDC*

Generally you subclass a control and handle the WM_PAINT message. Then you obtain the DeviceContext and call BeginPaint() then you paint then you EndPaint(). Make sense?

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top