Bananafish
May 21st, 2002, 05:25 AM
When coding the equivelent of control arrays in vb.Net, I have been using event functions with multiple Handles parameters.
ie,
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.)
Dim mnuX As MenuItem
mnuX = CType(sender, MenuItem)
if mnuX.Text.StartsWith("Insert" Then
...
End If
Can anyone help?
ie,
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.)
Dim mnuX As MenuItem
mnuX = CType(sender, MenuItem)
if mnuX.Text.StartsWith("Insert" Then
...
End If
Can anyone help?