static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); /* * ApplicationContext ac = new ApplicationContext(); * SudokuGrid grid = new SudokuGrid(false); * * Form f1 = new GridForm(grid); * Form f2 = new ControlForm(grid); * Rectangle r = Screen.PrimaryScreen.WorkingArea; * f1.Location = new Point((r.Width - f1.Width - f2.Width) / 2, (r.Height - f1.Height) / 2); * f2.Location = new Point((r.Width + f1.Width - f2.Width) / 2, (r.Height - f2.Height) / 2); * f1.Show(); * f2.Show(); * * f2.AddOwnedForm(f1); * * Application.Run(ac); */ var options = new SudokuGrid.GridOptions(3, 3, '1'); SudokuForm form = new SudokuForm(new SudokuGrid(options)); Application.Run(form); }
public SudokuForm() { System.Diagnostics.Debug.Assert(Instance == null); Instance = this; InitializeComponent(); CreateChildMenus(); LoadOptions(); }
public void InitControls(SudokuForm form, SudokuGrid.GridOptions options) { this.form = form; tbWidth.Text = options.cellA.ToString(); tbHeight.Text = options.cellB.ToString(); rbJigsaw.Checked = options.isJigsaw; rbKiller.Checked = options.isKiller; rbNormal.Checked = !options.isJigsaw && !options.isKiller; cbMajorDiagonal.Checked = options.majorDiagonal; cbMinorDiagonal.Checked = options.minorDiagonal; }
public SudokuForm(SudokuGrid grid) { System.Diagnostics.Debug.Assert(Instance == null); Instance = this; InitializeComponent(); sudokuControl.Grid = grid; CreateChildMenus(); UpdateMode(); LoadOptions(); }