i am a newbie and so have simple problem. i am using MFC in my app.
how could i draw on dialog box... i want to draw small rectangles in it and add functionality to them.
thanks
Printable View
i am a newbie and so have simple problem. i am using MFC in my app.
how could i draw on dialog box... i want to draw small rectangles in it and add functionality to them.
thanks
Handle WM_PAINT message.
what kind of functionality??
If you want to select objects and so on, you have to use a special draw object for this (as far as I know)... If you just want to draw them, you can use this code:
Code:CPaintDC dc(this); // device context for painting
int x = 50, y = 50; // add your own coordinates here
int iSize = 10; // add the size you want
brush.CreateSolidBrush(RGB(150, 50, 50)); // you own color here, this is red
dc.SelectObject(brush);
dc.Ellipse(x - iSize, y - iSize, x + iSize, y + iSize);
brush.DeleteObject();
NOTE: Do not delete a drawing object (pen or brush) while it is still selected into a DC.Quote:
Originally Posted by Tischnoetentoet