• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 195
  • Last Modified:

To retain a line on the screen.

I am trying to draw line between points LBUTTONDOWN and LBUTTONUP.But cannot retain the previous line when trying to draw the subsequent line.How can i retain the previous lines on the screen.
  • 2
1 Solution
could you post the relevant sections of your code please the LBUTTONDOWN and UP code?
Normaly a Program draws what it has to draw inside the OnDraw function.
This function is at last called if the window is invalidated.
Invalidated means: All drawings inside the window are not valid and have to be redrawn.
So you have to hold all LBUTTONDOWN and LBUTTONUP pairs to draw mor then the last line
Norbert is right, Why I wanted to post your code is this, Now normally if you are storing the point in button up event and using Lineto in down event the line is drawn. But if in these events if you are calling Invalidate(), then all the drawn lines dissapear, You'll have to have a mechanism to store these points and draw lines in OnDraw()
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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