How do you get the control that was clicked to open a ContextMenuStrip?

前端 未结 5 520
醉梦人生
醉梦人生 2020-12-16 18:47

I\'m using a ContextMenuStrip for multiple controls and I\'m trying to figure out the best way to get the control that was actually clicked on to open the Conte

5条回答
  •  悲哀的现实
    2020-12-16 19:51

    Private Sub kdgToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles kdgToolStripMenuItem.Click
        Dim sms = (sender.GetCurrentParent()).SourceControl.name
        MsgBox(sms)
    End Sub
    

    '///Faster

提交回复
热议问题