public void OdaButonlariniOlustur() { List <Oda> odalar = odaController.GetAll(); for (int i = 1; i <= Math.Ceiling((decimal)odaController.GetRoomCount() / 10); i++) { for (int n = 1; n <= 10; n++) { sayac++; btn = new Button(); btn.Location = new Point(n * 100 - 100, i * 62 - 10); //btn.Location = new Point(i * 100 - 100, n * 40 - 20); btn.Height = 40; btn.Width = 100; btn.Tag = sayac.ToString(); btn.Text = btn.Tag.ToString(); btn.Click += new EventHandler(RezeravsyonClicki); groupBox1.Controls.Add(btn); if (odaController.GetRoomCount() == sayac) { return; } } } }