Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,I want to draw on a panel(I want the points to be left on the panel where ever I drag on the form. so that I can draw line,circle,etc.) I dont want to loose my last painting when I start to paint again.what's the solution? Thanks in advance.
Posted
Updated 6-Dec-11 8:57am
v2
Comments
Wonde Tadesse 5-Dec-11 12:29pm    
Tag it. WPF, WinForm ...

1 solution

Handle the Panel.Paint event - it is called whenever the panel needs to be redrawn, so any painting you do there will automatically preserved. It hands you the Graphics context in the EventArgs, so you aren't responsible for getting or Disposing the context, and it can be prompted from your code by using the Panel.Invalidate method - so when you change something and it should cause a display change, call Invalidate on the panel, and it will occur.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900