Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


To retain a line on the screen.

Posted on 1999-07-14
Medium Priority
Last Modified: 2013-11-20
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.
Question by:arijitbhowmik
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Expert Comment

ID: 1310001
could you post the relevant sections of your code please the LBUTTONDOWN and UP code?

Accepted Solution

Norbert earned 150 total points
ID: 1310002
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

Expert Comment

ID: 1310003
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()

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

671 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question