Associate mouse event to objects in a PictureBox

  • Thread starter Thread starter Lopez Massimiliano
  • Start date Start date
L

Lopez Massimiliano

I'm trying C# to realize an electric CAD using C# and a PictureBox to draw
graphics objects like lines, curves and texts.

I need to associate mouse events to specific objects drawn. How can I do
that?

Thanks in advance

Max
 
Your object must have a message queues to be able to process messages. To do
that your objects must inherit from Control or Component in C#.

hope this helps

Fitim Skenderi
 
Your object must have a message queues to be able to process messages. To do
that your objects must inherit from Control or Component in C#.

hope this helps

Fitim Skenderi
 
* "Lopez Massimiliano said:
I'm trying C# to realize an electric CAD using C# and a PictureBox to draw
graphics objects like lines, curves and texts.

I need to associate mouse events to specific objects drawn. How can I do
that?

In the control's 'MouseDown'/'MouseUp' event handler, you can perform
hit-testing. You may want to store the objects as 'Region' objects and
use these regions to find out which object has been clicked.
 
Back
Top