How to Right Click Option on List Box Item with context Menu

  • Right Click Option on List Box Item with context Menu

    for further details and related topics http://www.codecorner.somee.com/
  • 1 Comment sorted by


  • Drag Drop Context menu Strip to form . from toolbox and write this code


    Private Sub ListBox1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListBox1.MouseDown
    If e.Button = Windows.Forms.MouseButtons.Right Then
    ListBox1.SelectedIndex = ListBox1.IndexFromPoint(e.X, e.Y)
    ContextMenuStrip1.Show(MousePosition)
    End If
    End Sub

    Private Sub ContextMenuStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles ContextMenuStrip1.ItemClicked
    MessageBox.Show("asdqweqe")
    End Sub


Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Popular Posts of the Week

    Optimum Creative