Ejemplo n.º 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();
        }
Ejemplo n.º 2
0
        private void SudokuControl_MouseMove(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)
            {
                toolTipText     = null;
                toolTip1.Active = false;
                return;
            }
            UpdateTooltip(x, y, Grid);
        }