Search code examples
c#winformsbuttoncontextmenustrip

how to show contextmenustrip when a button is clicked in the right position


I want to click on a button and have it show a ContextMenuStrip right below the button. It keeps showing up in the left hand side of the screen when i try PointToScreen and top and left coordinates.

Any suggestions?


Solution

  • I figured it out:

    layoutMenus.Show(Cursor.Position.X, Cursor.Position.Y);