pfullarton
New member
- Joined
- Aug 22, 2012
- Messages
- 3
- Programming Experience
- 10+
Hi Guys,
Just joined so apols if I get this wrong.....
I'm building an application that dynamically adds a variable number of a single user control into a panel and this is all working fine. Now, I'm trying to add an event handler to manage a click event for these controls.
First off is:
AddHandler CType(Nc, uclComp).MouseClick, AddressOf uclComp_Click
I then have this:
Public Sub uclComp_Click(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Nc.MouseClick
If e.Button = MouseButtons.Left Then MessageBox.Show(Nc.MachineName)
End Sub
The code all compiles and the ADD HANDLER code is executed fine. However, when I click any of the dynamically created controls uclComp_Click is NOT firing.
Any ideas?
Thx in advance.
Peter
Just joined so apols if I get this wrong.....
I'm building an application that dynamically adds a variable number of a single user control into a panel and this is all working fine. Now, I'm trying to add an event handler to manage a click event for these controls.
First off is:
AddHandler CType(Nc, uclComp).MouseClick, AddressOf uclComp_Click
I then have this:
Public Sub uclComp_Click(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Nc.MouseClick
If e.Button = MouseButtons.Left Then MessageBox.Show(Nc.MachineName)
End Sub
The code all compiles and the ADD HANDLER code is executed fine. However, when I click any of the dynamically created controls uclComp_Click is NOT firing.
Any ideas?
Thx in advance.
Peter