Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i am sudheer
i want to do a simple window based software
to draw a line using mouse
it's as same like draw a line in ms word
please help me ...
Posted

1 solution

This is really easy. Handle your mouse events, mouse down, up and move. Call Invalidate() to make your form redraw itself and use your Paint event to draw a line between the point that you stored as a starting point, and where the mouse is. Add the line to a collection of structs so your paint event can draw the lines you want to make permanent.
 
Share this answer
 

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



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