I have a custom control DigitalPanel
that has a FlowLayoutPanel(viewPanel
), which is filled with custom controls (DigitalIndicator
). When a user clicks on a DigitalIndicator
within the viewPanel
I would like to notify DigitalPanel
of this event. Currently I watch for viewPanel
's onMouseClick event, but this is only triggered when the spaces between the DigitialIndicators
is clicked and not when they are click on themselves.
So from what I have gathered on Stack Overflow is that I need to get the onMouseClick
event from each DigitalIndicator
before I add it to the viewPanel
and watch for these events from/in the viewPanel
's onMouseClick
event.
So then if a DigitalIndicator
is clicked, it will raise the event, viewPanel
will see that and in turn raise its onMouseClick
event which the DigitalPanel
will see and handle?
My issues is I am not sure how to get the DigitalIndicator
's onMouseClick
event from it. Here is what I have.
// This is from the DigitalPanel
class when a new DigitalIndicator
is being added
DigitalIndicatior newDigInd= new DigitalIndicatior();
this.viewPanel.MouseClick += new System.Windows.Forms.MouseEventHandler(newDigInd.);
I am not sure what the arguments to the MouseEventHandler
should be exactly. Suggestions?