Görsel Programlama (Güz-2016) Hafta-4-1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
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"; } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
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
Okumaya devam et
Son Yorumlar