title: Popup menu in VB.Net, equivalent to VB6?
body: <p>In VB6 I am using Menu Editor to store a list of students.
  e.g.
  Students 
  ....Bob
  ....Joe
  ....Bill
  ....James</p>
  
  <pre><code>PopupMenu Students
  </code></pre>
  
  <p>I then used the Visual studio 2008 wizard to convert the Vb6 project to .NET.</p>
  
  <p>How can I get this menu to work in .Net without too much change(event if the solution involves importing a VB6 DLL to .Net)?</p>
  
  <p>In .Net Student is now :</p>
  
  <pre><code>Public WithEvents Students As System.Windows.Forms.ToolStripMenuItem
  </code></pre>
  
  <p>So I did:</p>
  
  <pre><code>Students.ShowDropDown()
  </code></pre>
  
  <p>instead of:</p>
  
  <pre><code>PopupMenu Students
  </code></pre>
  
  <p>And it all works except the location. .net seems to be forcing the location to be 0,0. And I would like the menu to popup at the mouse click as it would in VB6.</p>
  
  <p>VB.NET Code:</p>
  
  <pre><code>&lt;Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()&gt; Partial Class StudentForm
  
      Public WithEvents Students As System.Windows.Forms.ToolStripMenuItem
      Public WithEvents John As System.Windows.Forms.ToolStripMenuItem
      Public WithEvents MainMenu1 As System.Windows.Forms.MenuStrip
      Friend WithEvents ContextMenuStrip1 As ContextMenuStrip
  
      //Initialise Component
      Private Sub InitializeComponent()
          Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
          Me.ContextMenuStrip1.Name = "ContextMenuStrip1"
          Me.ContextMenuStrip1.Size = New System.Drawing.Size(181, 26)
          Me.Students = New System.Windows.Forms.ToolStripMenuItem
          Me.John = New System.Windows.Forms.ToolStripMenuItem
          Me.MainMenu1 = New System.Windows.Forms.MenuStrip
          Me.MainMenu1.SuspendLayout()
  
          Me.Students.Name = "Students"
  
          Me.Students.Text = "Students"
  
          Me.Students.Visible = False
  
          Me.Students.Checked = False
  
          Me.Students.Enabled = True
  
  
          Me.John.Name = "John"
  
          Me.John.Text = "Johnny"
  
          Me.John.Checked = False
  
          Me.John.Enabled = True
  
          Me.John.Visible = True
  
          MainMenu1.Items.AddRange(New System.Windows.Forms.ToolStripItem(){ Me.Students})
          Students.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem(){ Me.John})
          Me.MainMenu1.ResumeLayout(False)
      End Sub
  End Class
  
  'MouseUp Event - 
  Students.ShowDropDown()' This work well bot the location is 0,0- not sure how to change
  
  ' I Also Tried Adding the context menu
  ContextMenu1.Items.Add(Students)- ' This does not show with sudents. But it shows if I do `ContextMenu1.Items.Add("Test")`
  ContextMenu1.Show()
  </code></pre>