if you don't know the shape, you could add a rectangular structure //that describes the (inner or outer) bounds of your shape to the path //_gPath.AddRectangle() if you know the exact shape and position of your objects, //you could put then in a GraphicsPath and on MouseClick //check, if MouseClick is inside the path Using(Graphics g = Graphics.FromImage(_bmp)) += new MouseEventHandler(pictureBox1_MouseClick) ![]() ![]() I do the setup for the handlers here, you also can do it via //properties-window in the design view this.FormClosing += new FormClosingEventHandler(Form1_FormClosing)
0 Comments
Leave a Reply. |