3

At the moment I am drawing rectangles using Windows Forms.

g.DrawRectangle(new Pen(Color.Black),new Rectangle(new Point(10,10),new Size(50,50)));

But I would like to add Event Listener to this so that I can make them moveable and resizeable.

Can I do this using Windows Form DrawRectangle() or is there a different way?

Moo-Juice
  • 38,257
  • 10
  • 78
  • 128
Jason
  • 654
  • 1
  • 11
  • 27

1 Answers1

1

You can use Panel's instead.

If you want them movable and resizeable - use Form's. (See this answer.)

(As for events for drawn objects like in your example - I don't know of a simple way to do that. But you can try calculating where the mouse clicked on the Form...)

Community
  • 1
  • 1
ispiro
  • 26,556
  • 38
  • 136
  • 291