Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MFC Drawing Lines

Tags:

visual-c++

mfc

I draw some lines on a SDI application in visual c++, these lines are disappeared whenenver a new line or the size of the windo is changed, any clue how to keep these lines visible all the time?

thanks.

RZ

like image 858
reonze Avatar asked May 31 '26 00:05

reonze


1 Answers

The Correct Function handler in an SDI Application is OnDraw. Any Painting instructions should be put here.

It might cause some confusion that sdi/mdi-applictaions use Ondraw, while dialog applications use OnPaint.

The reason your lines are vanishing is probably due to the standard behaviour of OnDraw(), which is to clear the client area as its first action when it is invoked.

Update: Ondraw is a member of the View

http://msdn.microsoft.com/en-us/library/e6htdchf%28VS.80%29.aspx

like image 198
sum1stolemyname Avatar answered Jun 02 '26 21:06

sum1stolemyname



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!