public Form1() { InitializeComponent(); Bitmap Cbitmap = new Bitmap(Resources.mine2, 64, 64); Opened = 0; Score = new Label(); Score.Show(); MinesL = new Label(); MinesL.Show(); Controls.Add(MinesL); Controls.Add(Score); Cbitmap.MakeTransparent(Color.White); System.IntPtr icH = Cbitmap.GetHicon(); Icon = Icon.FromHandle(icH); //Icon = new IconConverter(Resources.mine2); this.FormBorderStyle = FormBorderStyle.FixedSingle; button1.Image = new Bitmap(Resources.sun, button1.Height - 2, button1.Width - 2); minefield = new obj[20][]; for (int i = 0; i < 20; i++) { minefield[i] = new obj[20]; } initializeField(); l = Level.Beginner; newGame(); }
//gi kreira site polinja 20x20 public void initializeField() { int x = 10, y = 75; for (int i = 0; i < 20; i++) { for (int j = 0; j < 20; j++) { minefield[i][j] = new obj(52, y, x, "none", i, j); Controls.Add(minefield[i][j].b); x += 51; } x = 10; y += 51; } }