コード例 #1
0
        private void SudokuControl_MouseClick(object sender, MouseEventArgs e)
        {
            PickContext context = new PickContext(ClientSize, CellA, CellB);
            int         x, y;

            context.PositionOf(e.X, e.Y, out x, out y);
            if (x < 0 || x >= Cells || y < 0 || y >= Cells)
            {
                return;
            }
            if (grid.PlayMode == SudokuGrid.PlayModes.EditBox)
            {
                if (grid.IsJigsaw)
                {
                    grid.ChangeBox(x, y);
                }
            }
            else if (x == selx && y == sely)
            {
                ClearSelection();
            }
            else
            {
                MakeSelection(x, y);
            }
            Invalidate();
        }