[RESOLVED] Programmically Add a Context Menu?
Does anyone know how to add a Context menu to a form programically?
I tried creating a Context Menu object and showing that, but I kept getting a Reference Not Set error.
This is what I've done so far,
VB Code:
Dim ContextMenu As New ContextMenu
ContextMenu.MenuItems.Add("Print")
ResultsListView.ContextMenu = ContextMenu
Me.ContextMenu.Show(ResultsListView, New Point(100, 100))
Any help would be appreciated.
~Crush
Re: Programmically Add a Context Menu?
Change the name of it as your using the reserved name of the control as the control name.