Normally we dont have any event for the Drawing objects like circle, eclipse ect., so here I am trying to draw a eclipse using graphics and try to give clicking effect and handing that event.
Declare the event handler and deligate to handle the events
Initialise the Click Event for eclipse we are drawing in Form_Load
Draw eclipse in Form paint method
To give clicking effect we need to draw a similar eclipse when you
press the mouse, also check the bounds where mouse is being clicked, please add following code in Form1_MouseDown
And add following code in Form1_MouseUp
Following event will be called when you click the eclipse, so please add following code block
Now we are ready our code just build, run and test.
Tags: Drawing in C#, Eclipse, Handling Events
No comments:
Post a Comment