i have 4 menu items that i would like to code 1 sub for and use a select case against the sender to see which menu item was selected but i dont know what to cast the menu item as:
it'd be a really easy thing to do, and i can do it this way with buttons, except i need it in a menu it would be pointless to have to code it in 4 seperate subs that i would have to maintain lol
VB.NET:
Private Sub mnuDifficultys_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuDifficulty1.Click, mnuDifficulty2.Click, mnuDifficulty3.Click, mnuDifficulty4.Click
Select Case CType(sender, MenuItem).Name
Case "mnuDifficulty1": gintDifficulty = 1
Case "mnuDifficulty2": gintDifficulty = 2
End Select
it'd be a really easy thing to do, and i can do it this way with buttons, except i need it in a menu it would be pointless to have to code it in 4 seperate subs that i would have to maintain lol