When coding the equivelent of control arrays in vb.Net, I have been using event functions with multiple Handles parameters.
ie,
VB Code:
Private Sub mnuFileModify_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFileModify.Click, mnuFileInsert.Click, mnuFileDelete.Click
My question then is how to detect from the Sender parameter the name of the individual control.
I can use the following code to extract various properties - ie, the "Text" property - but I would prefer to actually refer to the Control Name (mnuFileInsert etc.)
VB Code:
Dim mnuX As MenuItem mnuX = CType(sender, MenuItem) if mnuX.Text.StartsWith("Insert" Then ... End If
Can anyone help?


Reply With Quote