Is there a Way to Add a Click event to a Rectangle that is created at run time?
I use the Following Code to Create the Rectangle:
I want this rectangle to trigger a Sub when the user clicks anywhere inside the Rectangle.Code:Dim g As Graphics = TableLayoutPanel1.CreateGraphics() Dim rect As RectangleF = New Rectangle(100, 100, 100, 400) g.FillRectangle(Brushes.Red, rect) g.Dispose()




Reply With Quote