Click here to Skip to main content
15,890,825 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Print and Print Preview and relation with document view Pin
«_Superman_»16-Aug-09 19:06
professional«_Superman_»16-Aug-09 19:06 
QuestionMouse as an erasing tool Pin
kudlaty7915-Aug-09 10:06
kudlaty7915-Aug-09 10:06 
AnswerRe: Mouse as an erasing tool Pin
Michael Schubert15-Aug-09 13:22
Michael Schubert15-Aug-09 13:22 
AnswerRe: Mouse as an erasing tool Pin
«_Superman_»15-Aug-09 17:41
professional«_Superman_»15-Aug-09 17:41 
GeneralRe: Mouse as an erasing tool Pin
kudlaty7916-Aug-09 3:08
kudlaty7916-Aug-09 3:08 
GeneralRe: Mouse as an erasing tool Pin
Cedric Moonen16-Aug-09 20:13
Cedric Moonen16-Aug-09 20:13 
GeneralRe: Mouse as an erasing tool Pin
kudlaty7916-Aug-09 23:01
kudlaty7916-Aug-09 23:01 
GeneralRe: Mouse as an erasing tool Pin
Cedric Moonen16-Aug-09 23:14
Cedric Moonen16-Aug-09 23:14 
Please use the pre tags to format your code properly as specified in the posting guidelines.

Now to your problem: you approach on drawing your data is wrong. You shouldn't draw directly on the screen in response to a mouse event. Doing so will causes many problems: try to put another window in front of your window (or minimizing your window) and then making your window visible again. You'll see that your drawings have disappeared.
What you should do instead is store all the points where you clicked with the mouse as pure data and refresh your view. The OnPaint handler will be called and there you need to redraw everything. Search for the scribble example on MSDN, this will show you exactly how to do so.

Once this is done, erasing becomes "easier" because you only need to remove points of data which are stored in your document. This depends a bit how you want your erase tool to work: remove a complete line, or only sections, ...

Cédric Moonen
Software developer

Charting control [v2.0]
OpenGL game tutorial in C++

QuestionHow to double click desktop icon programatically? Pin
birajendu15-Aug-09 9:15
birajendu15-Aug-09 9:15 
QuestionRe: How to double click desktop icon programatically? Pin
David Crow15-Aug-09 10:40
David Crow15-Aug-09 10:40 
AnswerRe: How to double click desktop icon programatically? Pin
Stuart Dootson15-Aug-09 13:28
professionalStuart Dootson15-Aug-09 13:28 
GeneralRe: How to double click desktop icon programatically? Pin
birajendu15-Aug-09 18:35
birajendu15-Aug-09 18:35 
AnswerRe: How to double click desktop icon programatically? Pin
Graham Shanks15-Aug-09 23:04
Graham Shanks15-Aug-09 23:04 
QuestionHow to print an a 4x4 array in clockwise direction Pin
sharp_k15-Aug-09 8:59
sharp_k15-Aug-09 8:59 
AnswerRe: How to print an a 4x4 array in clockwise direction Pin
Chris Losinger15-Aug-09 9:36
professionalChris Losinger15-Aug-09 9:36 
AnswerRe: How to print an a 4x4 array in clockwise direction Pin
Moreno Airoldi15-Aug-09 9:59
Moreno Airoldi15-Aug-09 9:59 
GeneralRe: How to print an a 4x4 array in clockwise direction Pin
sharp_k15-Aug-09 21:14
sharp_k15-Aug-09 21:14 
GeneralRe: How to print an a 4x4 array in clockwise direction Pin
Moreno Airoldi15-Aug-09 22:54
Moreno Airoldi15-Aug-09 22:54 
GeneralRe: How to print an a 4x4 array in clockwise direction Pin
sharp_k16-Aug-09 4:59
sharp_k16-Aug-09 4:59 
GeneralRe: How to print an a 4x4 array in clockwise direction Pin
Moreno Airoldi16-Aug-09 7:50
Moreno Airoldi16-Aug-09 7:50 
GeneralRe: How to print an a 4x4 array in clockwise direction Pin
sharp_k16-Aug-09 8:50
sharp_k16-Aug-09 8:50 
GeneralRe: How to print an a 4x4 array in clockwise direction Pin
Moreno Airoldi16-Aug-09 9:35
Moreno Airoldi16-Aug-09 9:35 
GeneralRe: How to print an a 4x4 array in clockwise direction Pin
sharp_k16-Aug-09 13:58
sharp_k16-Aug-09 13:58 
QuestionVisual C++ 2008 runtime! Pin
Hadi Dayvary15-Aug-09 8:31
professionalHadi Dayvary15-Aug-09 8:31 
AnswerRe: Visual C++ 2008 runtime! Pin
Chris Losinger15-Aug-09 9:38
professionalChris Losinger15-Aug-09 9:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.