Görsel Programlama (Güz-2016) Hafta-4-1

gorsel_prog_2016_guz_hafta4_1-1

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ornek1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            breset_Click(null, null);
        }

        private void bgoster_Click(object sender, EventArgs e)
        {
            RadioButton[] rb_1 = { rb1, rb2, rb3 };
            RadioButton[] rb_2 = { rb4, rb5, rb6 };

           /* if (rb1.Checked)
            {
                lasecim1.Text = rb1.Text;
            }

            if (rb2.Checked)
            {
                lasecim1.Text = rb2.Text;
            }

            if (rb3.Checked)
            {
                lasecim1.Text = rb3.Text;
            }*/

            for(int i=0;i<rb_1.Length;i++)
                if(rb_1[i].Checked){
                    lasecim1.Text = rb_1[i].Text;
                    break;
                }
            for (int i = 0; i < rb_2.Length; i++)
                if (rb_2[i].Checked)
                {
                    lasecim2.Text = rb_2[i].Text;
                    break;
                }
        }

        private void breset_Click(object sender, EventArgs e)
        {
            rb1.Checked = true;
            rb4.Checked = true;
            lasecim1.Text = "Seçim Yok";
            lasecim2.Text = "Seçim Yok";
        }
    }
}

 

gorsel_prog_2016_guz_hafta4_1-2

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ornek2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void breset_Click(object sender, EventArgs e)
        {
            //MessageBox.Show("Tıklandı!");

           /* int b_x = breset.Location.X;
            int b_y = breset.Location.Y;
            breset.Location = new Point(b_x + 50, b_y - 60);*/
        }

        private void rb_1_Click(object sender, EventArgs e)
        {
            RadioButton rb = (RadioButton)sender;

            if (rb.Checked)
                lasecim1.Text = rb.Text;

        }

        private void rb_2_Click(object sender, EventArgs e)
        {

            RadioButton rb = (RadioButton)sender;

            if (rb.Checked)
                lasecim2.Text = rb.Text;
        }
        
    }
}

GP (Güz-2016) Hafta-4/1

Share