コード例 #1
0
        private void DrawGames(SudokuGameForm SForm, Game g)
        {
            Font  LabelFont = new Font("Segoe UI Symbol", 12);
            Size  s = new Size(g.gridWidth * boxWidth, g.gridWidth * boxWidth + boxWidth);
            Panel Original = MakePanel(10, 10, s, "Original", "Original");
            Panel GameSave = MakePanel((Original.Width) + boxWidth, 10, s, "Game Save", "GameSave");
            int   col, row;
            Label OG, GS;

            for (int c = 0; c < g.originalNumbersArray.Length; c++)
            {
                col = g.GetColumnByIndex(c);
                row = g.GetRowByIndex(c);
                OG  = SForm.AddLabel(
                    "Original" + c,
                    g.originalNumbersArray[c] == 0 ? "" : g.originalNumbersArray[c].ToString(),
                    row,
                    col
                    );
                GS = SForm.AddLabel(
                    "GameSave" + c,
                    g.numbersArray[c] == 0 ? "" : g.numbersArray[c].ToString(),
                    row,
                    col
                    );
                OG.Click      += SudokuCellLabel_Clicked;
                GS.Click      += SudokuCellLabel_Clicked;
                OG.MouseEnter += SudokuCellLabel_Hover;
                GS.MouseEnter += SudokuCellLabel_Hover;
                GameSave.Controls.Add(GS);
                Original.Controls.Add(OG);
            }
            Controls.Add(Original);
            Controls.Add(GameSave);
            SetFormSize(20 + Original.Width + GameSave.Width + boxWidth, (g.gridWidth + 2) * boxWidth + CancelBtn.Height + 10);
        }
コード例 #2
0
 public LoadGameForm(SudokuGameForm SForm, Game g)
 {
     InitializeComponent();
     DrawGames(SForm, g);
 }