title: How to create a context menu in C#
body: <p>I want to create a context menu using C# that will display next to the node similar to what happens here in Visual Studio:</p>
  
  <p><img src="https://i.stack.imgur.com/Y206y.png" alt=""></p>
  
  <p>The code I have now causes the main form to flicker.</p>
  
  <pre><code>private void treeView1_MouseDown(object sender, MouseEventArgs e)
  {
      if (e.Button == MouseButtons.Right)
      {
          var myForm = new Form {Text = "My Form"};
          myForm.SetBounds(10, 10, 200, 200);
  
          myForm.Show();
          // Determine if the form is modal.
          if (myForm.Modal == false)
          {
              // Change borderstyle and make it not a top level window.
              myForm.FormBorderStyle = FormBorderStyle.FixedToolWindow;
              myForm.TopLevel = false;
          }
      }            
  }
  </code></pre>