I have multiple Controls grouped in Groupboxes. I want to select the control from groupbox dynamically. For example, I am able to select the controls from GroupBox1 with the code below. However, I want to make it dynamically so that users can select any controls from any GroupBox.
Would appreciate your help and suggestion.
Private Sub addSelectedClickHandlers() Try For Each selectedControl As Control In GroupBox1.Controls AddHandler selectedControl.MouseMove, AddressOf selectedControl_MouseMove AddHandler selectedControl.MouseLeave, AddressOf selectedControl_MouseLeave Next Catch ex As Exception Debug.Print(ex.ToString) End Try End Sub