private void ShowValue(CELL p, int x, int y) { if (p.CellValue == 0) { pole[x][y].BackImage = Image.FromFile(@"../imag/0.png"); CheckNull(x, y); } else { pole[x][y].BackImage = Image.FromFile(@"../imag/greenNum/" + pole[x][y].CellValue + ".png"); } pole[x][y].IsOpen = true; }
private void LoadGame() { en = new EnterMy(); en.ShowDialog(); switch (en.Lavel) { case 0: sizePol = 4; numberBomba = numberBombFlags = 2; locSdvig = 150; break; case 1: sizePol = 8; numberBomba = numberBombFlags = 6; break; case 2: sizePol = 12; numberBomba = numberBombFlags = 15; break; case 3: sizePol = 14; numberBomba = numberBombFlags = 30; break; default: sizePol = 8; numberBomba = 6; break; } InitializeComponent(); this.Visible = true; pole = new CELL[sizePol][]; for (int i = 0; i < sizePol; i++) { pole[i] = new CELL[sizePol]; for (int j = 0; j < sizePol; j++) { pole[i][j] = new CELL(); pole[i][j].CellValue = 0; pole[i][j].SizePanel = sizeBut; pole[i][j].LocationPanel = new Point((i * sizeBut) + locSdvig, j * sizeBut + 70); pole[i][j].BackImage = Image.FromFile(@"../imag/all.png"); pole[i][j].Panelpic.MouseDown += new MouseEventHandler(Panelpic_MouseDown); this.Controls.Add(pole[i][j].Panelpic); } } this.Size = new System.Drawing.Size(((sizePol * sizeBut + 15) < 331) ? 480 : (sizePol * sizeBut + 15), sizePol * sizeBut + sizeBut * 2 + 10); dt = new Timer(); fixTime = DateTime.Now; dt.Tick += new EventHandler(dt_Tick); dt.Interval = 300; dt.Start(); GetBomba(numberBomba); }
private void ShowValue(CELL p,int x,int y) { if (p.CellValue == 0) { pole[x][y].BackImage = Image.FromFile(@"../imag/0.png"); CheckNull(x, y); } else { pole[x][y].BackImage=Image.FromFile(@"../imag/greenNum/" + pole[x][y].CellValue + ".png"); } pole[x][y].IsOpen = true; }
private void LoadGame() { en = new EnterMy(); en.ShowDialog(); switch (en.Lavel) { case 0: sizePol = 4; numberBomba = numberBombFlags = 2; locSdvig = 150; break; case 1: sizePol = 8; numberBomba = numberBombFlags = 6; break; case 2: sizePol = 12; numberBomba = numberBombFlags = 15; break; case 3: sizePol = 14; numberBomba = numberBombFlags = 30; break; default: sizePol = 8; numberBomba = 6; break; } InitializeComponent(); this.Visible = true; pole = new CELL[sizePol][]; for (int i = 0; i < sizePol; i++) { pole[i] = new CELL[sizePol]; for (int j = 0; j < sizePol; j++) { pole[i][j] = new CELL(); pole[i][j].CellValue = 0; pole[i][j].SizePanel = sizeBut; pole[i][j].LocationPanel = new Point((i * sizeBut)+locSdvig, j * sizeBut + 70); pole[i][j].BackImage = Image.FromFile(@"../imag/all.png"); pole[i][j].Panelpic.MouseDown += new MouseEventHandler(Panelpic_MouseDown); this.Controls.Add(pole[i][j].Panelpic); } } this.Size = new System.Drawing.Size(((sizePol * sizeBut + 15) < 331) ? 480 : (sizePol * sizeBut + 15), sizePol * sizeBut + sizeBut * 2 + 10); dt = new Timer(); fixTime = DateTime.Now; dt.Tick += new EventHandler(dt_Tick); dt.Interval = 300; dt.Start(); GetBomba(numberBomba); }