Popup Menu

Posts 15 of 5 · Page 1 of 1
Popup Menu
I need help on how to show a popup menu by using codejock control.
I want the menu popup when i rightclick an item on a listview just like a normal popup menu would do.

Since there is no tutorial on google on how to do it, i hope someone here might have some insight.

Thanks.
Maybe a ContextMenuStrip control?

Code:
'//When the PictureBox is RIGHT clicked, it will show the context menu, at the cursor
    Private Sub PictureBox1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseUp
        If e.Button = MouseButtons.Right Then
            ContextMenuStrip1.Show(Cursor.Position)
        End If
    End Sub
Code:
    Private Sub ContextMenuStrip1_ItemClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles ContextMenuStrip1.ItemClicked
        Select Case e.ClickedItem.Text
            Case "Option1"
                MessageBox.Show("You clicked item # 1")
            Case "Option2"
                MessageBox.Show("You clicked item # 2")
            Case "Item3"
                MessageBox.Show("You clicked item # 3")
            Case "Item4"
                MessageBox.Show("You clicked item # 4")
        End Select
   '// None of my items.Text are actually equal to 'Option1,Option2,Item3,Item4', so the msg boxes won't fire ; but you get the idea.
    End Sub


If you have a bunch of controls you want a context menu for, it may be easier to create ContextMenuStrips in code (as opposed to on the IDE) for each item you right click, and setting up the events manually using AddHandler. vb.net - Right click: menu options - Stack Overflow It's a lot to explain depending on how much you've used controls and event handlers. Not enough time before work to make a proper tut., hope the above helped.

edit: For further reading maybe try http://www.codeproject.com/Articles/...isual-Basic-NE
Tbh im using vb6 for my gui thats why im using codejock control to skin my app.
Since there is no tutorial on how to make a popup menu using codejock control, i dont even know how to code it.
Thanks for the info though, maybe i just need to use the standard vb6 control instead =\
Quote Originally Posted by StoneHeart View Post
...
Ah, I apologize, since vb6 is now virtually obsolete, I tend to think "vb" stands for "vb.net". I wish I could help, best of luck.
Quote Originally Posted by abuckau907 View Post
Ah, I apologize, since vb6 is now virtually obsolete, I tend to think "vb" stands for "vb.net". I wish I could help, best of luck.
Nahh, vb6 app still runs fine on win 8 =)

Anyway, ive solved the popup menu problem =)

Damn, wasted 2 hours try & error each codejock control classes which is isnt well documented =\
Posts 15 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?