示例#1
0
        private void CreateWidget()
        {
            Button btnExitGame = new Button
            {
                Name                  = "btnExitGame",
                BackgroundImage       = Properties.Resources.GameExit,
                BackgroundImageLayout = ImageLayout.Stretch,
                AutoSize              = true,
                FlatStyle             = FlatStyle.Popup,
                Location              = new Point(721, 445),
                Size                  = new Size(73, 61),
            };

            Button btnHome = new Button
            {
                Name                  = "btnHome",
                BackgroundImage       = Properties.Resources.home,
                BackgroundImageLayout = ImageLayout.Stretch,
                AutoSize              = true,
                FlatStyle             = FlatStyle.Popup,
                Location              = new Point(0, 445),
                Size                  = new Size(73, 61),
            };
            Button btnYeniOyun = new Button
            {
                Name                  = "btnYeniOyun",
                BackgroundImage       = Properties.Resources.refresh,
                BackgroundImageLayout = ImageLayout.Stretch,
                AutoSize              = true,
                FlatStyle             = FlatStyle.Popup,
                Location              = new Point(74, 445),
                Size                  = new Size(73, 61),
            };

            this.Controls.Add(btnExitGame);
            this.Controls.Add(btnHome);
            this.Controls.Add(btnYeniOyun);
            btnExitGame.Click += (object sender, EventArgs e) => { Application.Exit(); };
            btnHome.Click     += (object sender, EventArgs e) => { this.Close(); };
            btnYeniOyun.Click += (object sender, EventArgs e) =>
            {
                Oyun oyun = new Oyun();
                oyun.Show();
                this.Close();
            };
        }
示例#2
0
        private void BtnCreate()
        {
            Button btnYeniOyun = new Button
            {
                Name                  = "btnYeniOyun",
                BackgroundImage       = Properties.Resources.oyunaBasla,
                BackgroundImageLayout = ImageLayout.Stretch,
                AutoSize              = true,
                FlatStyle             = FlatStyle.Popup,
                Location              = new Point(154, 85),
                Size                  = new Size(532, 191),
            };

            Button btnSkor = new Button
            {
                Name                  = "btnSkor",
                BackgroundImage       = Properties.Resources.Skor,
                BackgroundImageLayout = ImageLayout.Stretch,
                AutoSize              = true,
                FlatStyle             = FlatStyle.Popup,
                Location              = new Point(154, 282),
                Size                  = new Size(263, 142),
            };
            Button btnNasilOynanir = new Button
            {
                Name                  = "btnNasilOynanir",
                BackgroundImage       = Properties.Resources.nasılOynanır,
                BackgroundImageLayout = ImageLayout.Stretch,
                AutoSize              = true,
                FlatStyle             = FlatStyle.Popup,
                Location              = new Point(423, 282),
                Size                  = new Size(263, 142),
            };

            Button btnMinimize = new Button
            {
                Name                  = "btnMinimize",
                BackgroundImage       = Properties.Resources.minimize,
                BackgroundImageLayout = ImageLayout.Zoom,
                AutoSize              = true,
                FlatStyle             = FlatStyle.Popup,
                Location              = new Point(808, 1),
                Size                  = new Size(34, 31),
                BackColor             = Color.Transparent
            };
            Button btnExit = new Button
            {
                Name                  = "btnExit",
                BackgroundImage       = Properties.Resources.exit,
                BackgroundImageLayout = ImageLayout.Zoom,
                AutoSize              = true,
                FlatStyle             = FlatStyle.Popup,
                Location              = new Point(848, 1),
                Size                  = new Size(29, 31),
                BackColor             = Color.Transparent
            };

            this.Controls.Add(btnYeniOyun);
            this.Controls.Add(btnSkor);
            this.Controls.Add(btnNasilOynanir);
            this.Controls.Add(btnMinimize);
            this.Controls.Add(btnExit);


            btnYeniOyun.Click += (object sender, EventArgs e) =>
            {
                Oyun game = new Oyun();
                game.Show();
            };

            btnSkor.Click += (object sender, EventArgs e) =>
            {
                Skor skor = new Skor();
                skor.Show();
            };

            btnNasilOynanir.Click += (object sender, EventArgs e) =>
            {
                NasılOynanir nasılOynanir = new NasılOynanir();
                nasılOynanir.Show();
            };
            btnMinimize.Click += (object sender, EventArgs e) =>
            {
                WindowState = FormWindowState.Minimized;
            };
            btnExit.Click += (object sender, EventArgs e) =>
            {
                Application.Exit();
            };
        }