Пример #1
0
        private void OnMouseDown(object sender, MouseEventArgs e)
        {
            bool showContextMenu = false;

            if (e.Button == MouseButtons.Left)
            {
                showContextMenu = boardLogic.OnMouseLeft(position.Row, position.Column);
            }
            else if (e.Button == MouseButtons.Right)
            {
                showContextMenu = boardLogic.OnMouseRight(position.Row, position.Column);
            }

            if (showContextMenu)
            {
                var point = Cursor.Position;
                point.X += 10;
                point.Y += 10;
                contextMenu.Show(point);
            }
        }