context menu ?

  • Thread starter Thread starter Lloyd Dupont
  • Start date Start date
L

Lloyd Dupont

how is the context menu (the red dotted circle when you do a loong press)
managed ?
I mean which event trigger it ?

it's obviously not a double clic, it doens't exist in MouseEventArgs ...
 
Or.... Code one yourself e.g

Friend WithEvents OptionMenu As System.Windows.Forms.ContextMenu

....add menu items

Friend WithEvents OptionMenuItem1 As System.Windows.Forms.MenuItem

Me.OptionMenu = New System.Windows.Forms.ContextMenu

Me.OptionMenuItem1 = New System.Windows.Forms.MenuItem

MeOptionMenuItem1.Text = "Whatever"

....Define the popup point

Dim pos As Point

pos.X = 20

pos.Y = 20

....and fire it up in the required context / event

Me.OptionMenu.Show(Me, pos)

O.K. so it does depend on the events available for the control in question
that you require the context menu for, but I've coded it this way for both
control.click and control.mousedown / control.mouseup with a timer.tick
event. You don't get the red dot circle, but it works for me.
 
Back
Top