How to add menu by right clicking listview row item?

You can talk about VB programming here

How to add menu by right clicking listview row item?

Postby method » Thu May 03, 2007 4:11 pm


Hi all. could any one show me how i can add menu as shown in pic by right clicking listview item and by selecting an item and it opens new form(linking sub item of menu to form). I be happy if some one show me how this can be done.Thanks


I created menu using menu editor as shown in pic but i don't know how to make
it visible when i right click listview item so i be able to select items.Now the menue is in the top
of form!!Could u tell me what i am doing wrong? I keep right clicking and nothing happens.Furthermore,
how to link menu sub items to diffrent forms?



Code: Select all

Private Sub ListView1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
 If Button = 2 Then PopupMenu mnuName

End Sub

Private Sub mnuName_Click()
  MsgBox ListView1.SelectedItem.Text
End Sub


This is the type of menue i want:
Image
This how i made menu:

Image
Last edited by method on Fri May 04, 2007 12:31 am, edited 4 times in total.
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Postby autopilot » Fri May 04, 2007 8:01 am

To do it in VB 2005, you add a "ContextMenuStrip" and then associate that with the object (in your case a listview). I do not know if VB6 has contextmenustrips, but that would be what I would look for.

autopliot
User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 356
Joined: Sat Sep 23, 2006 7:19 pm

Postby BattleStar-Galactica » Fri May 04, 2007 2:52 pm

Sorry to say that but have you typed in google context menu + vb6
Big math problem
2 - 1 = 0 = without you I'm nothing
User avatar
BattleStar-Galactica
imFiles Master
imFiles Master
 
Posts: 565
Joined: Tue Sep 20, 2005 12:19 am
Location: safest place to hide


Return to Visual Basic Programming

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests