I have created a simple custom control - we will call it a "panel with buttons". Here is how I instantiate it:
So what I wind up with are multiple instances of my panel. Each of these panels has a button on it called Button1.
My question is - how do I capture this button event in a way that I will know which panel index it came from?
In the custom control there is only the Button1_click event - and when I click on it in any of the multiple panels I manually instantiated the event does occur, but I'm clueless as to how I can tell which one of my instantiated buttons were clicked...
Code:
Dim Panel(PanelCount) As Panel.Panel
Dim iTop As Integer = 5
For I As Integer = 0 To (PanelCount - 1)
Panel(I) = New Panel.Panel
Panel(I).Parent = Me
'the following just position the panels
Panel(I).Top = iTop + 10
iTop += 110
Panel(I).Left = 5
Next I
My question is - how do I capture this button event in a way that I will know which panel index it came from?
In the custom control there is only the Button1_click event - and when I click on it in any of the multiple panels I manually instantiated the event does occur, but I'm clueless as to how I can tell which one of my instantiated buttons were clicked...
Comment