title: How to position a Popup Menu to the left side of a Button?
body: <p>I have a Popup menu. The Popup menu has a two-column layout. Therefore, the Buttons are aligned in two columns, which are the left column and the right column. Inside it, there are Buttons.<br />
  Upon clicking one of the Buttons, it will open a Dropdown Menu (created using <code>ContextMenuStrip</code>).</p>
  <p>This is how the popup menu and its contents look like:</p>
  <p><a href="https://i.stack.imgur.com/kShNV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kShNV.png" alt="popupMenu" /></a></p>
  <p>I have no problem to place the dropdown menu on the right width of the &quot;Style token&quot; button. The problem occurs when I'm trying to place the Dropdown Menu on the left width of the &quot;Remove style&quot; button.<br />
  The image below shows the examples:</p>
  <p>The dropdown location on the right width of the &quot;Style token&quot; Button works just fine.</p>
  <p><a href="https://i.stack.imgur.com/7f3lG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7f3lG.png" alt="rightColumn" /></a></p>
  <p>The Dropdown location on the left width of the &quot;Remove style&quot; Button is problematic as I don't really know how to code the logic of it.<br />
  It should look as shown below:</p>
  <p><a href="https://i.stack.imgur.com/9LfK7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9LfK7.png" alt="leftColumn" /></a></p>
  <hr />
  <p>Actually, I've coded the part I'm having an issue with. However, I'm not really sure if this is the conventional or professional way of coding it. Also, there are times there will be a random gap between the left Dropdown Menu with the &quot;Remove Style&quot; Button.<br />
  Below shows the code example:</p>
  <pre><code>//--global variable--
  int removeStyleStripXPos; //to store xPos of left column dropdown menu
  
  //removeStyleStrip -&gt; the left dropdown menu
  //styleTokenStrip -&gt; the right dropdown menu
  //--global variable--
  
  //--the mouseUp event handler of &quot;Remove style&quot; button--
  private void button13_MouseUp(object sender, MouseEventArgs e)
  {
      if (e.Button == MouseButtons.Left)
      {
          removeStyleStrip.Show(button13, new Point(removeStyleStripXPos, 0));
      }
  }
  
  //--the mouseUp event handler of &quot;Style token&quot; button--
  private void button14_MouseUp(object sender, MouseEventArgs e)
  {
      if (e.Button == MouseButtons.Left)
      {
          styleTokenStrip.Show(button14, new Point(this.button14.DisplayRectangle.Right, 0));
      }
  }
  
  //--the load event handler of the two column popup menu--
  private void TCPopupMenuFull_Load(object sender, EventArgs e)
  {
      removeStyleStripXPos = -(this.removeStyleStrip.Width);
  }
  </code></pre>
  <p>So, may I know if there are better ways of setting the position of the Dropdown Menu to the left end of the &quot;Remove style&quot; Button?</p>