Left Click Context Menu
Use this board to post your code snippets - tips and tricks
3 posts
Page 1 of 1
hey guys,
well today i have found an older code, even know it didnt work at frist but i have fixed it .
this code helps opening context menu's on a left click. Frist off take the item you want this to be on, and get the private sub [Mouse Click]
Example :
well today i have found an older code, even know it didnt work at frist but i have fixed it .
this code helps opening context menu's on a left click. Frist off take the item you want this to be on, and get the private sub [Mouse Click]
Example :
Code: Select all
and then add this code
Private Sub SearchPic_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles SearchPic.MouseClick
End Sub
Code: Select all
Dim x As Integer
Dim y As Integer
x = Windows.Forms.Cursor.Position.X - Me.Location.X - 5
y = Windows.Forms.Cursor.Position.Y - Me.Location.Y - 23
Dim xy As New Point(x, y)
[context menu name].Show(Me, xy)
Hey just so everyone know's theres a one line code for this if you mean the ContextMenu System Styled one then:
go to Form_load:
go to Form_load:
Code: Select all
'heres an example with listview:
ListView1.ContextMenu = ContextMenu1
You're crazy!
I'm not crazy, my mother had me tested. ~Sheldon Cooper
I'm not crazy, my mother had me tested. ~Sheldon Cooper
agust1337 wrote:Hey just so everyone know's theres a one line code for this if you mean the ContextMenu System Styled one then:thats for the right click... the one he shows above is for left click ... :lol:
go to Form_load:Code: Select all'heres an example with listview: ListView1.ContextMenu = ContextMenu1
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
3 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023