Gerekli araçlar
/* Burada anaokulu mezunu ise ekrana yazdırmasını istiyoruz. */
if (radioButton1.Checked == true)
MessageBox.Show(radioButton1.Text + " mezunusun.");
/* Burada ilkokul mezunu ise ekrana yazdırmasını istiyoruz. */
else if (radioButton2.Checked == true)
MessageBox.Show(radioButton2.Text + " mezunusun.");
/* Burada ortaokul mezunu ise ekrana yazdırmasını istiyoruz. */
else if (radioButton3.Checked == true)
MessageBox.Show(radioButton3.Text + " mezunusun.");
/* Burada lise mezunu ise ekrana yazdırmasını istiyoruz. */
else if (radioButton4.Checked == true)
MessageBox.Show(radioButton4.Text + " mezunusun.");
/* Burada üniversite mezunu ise ekrana yazdırmasını istiyoruz. */
else if (radioButton5.Checked == true)
MessageBox.Show(radioButton5.Text + " mezunusun.");
/* Burada yüksek lisans mezunu ise ekrana yazdırmasını istiyoruz. */
else if (radioButton6.Checked == true)
MessageBox.Show(radioButton6.Text + " mezunusun.");
Not: radioButton1.Text kullanmamın sebebi siz radioButton'un yazısına ne yazarsanız onu göstermesini amaçlamakta. Ben 6 adet radioButton kullandım siz bunu daha fazla kullanabilirsiniz. Örneğin: Okumadım gibi.
- 1 adet button
- 6 adet radioButton
/* Burada anaokulu mezunu ise ekrana yazdırmasını istiyoruz. */
if (radioButton1.Checked == true)
MessageBox.Show(radioButton1.Text + " mezunusun.");
/* Burada ilkokul mezunu ise ekrana yazdırmasını istiyoruz. */
else if (radioButton2.Checked == true)
MessageBox.Show(radioButton2.Text + " mezunusun.");
/* Burada ortaokul mezunu ise ekrana yazdırmasını istiyoruz. */
else if (radioButton3.Checked == true)
MessageBox.Show(radioButton3.Text + " mezunusun.");
/* Burada lise mezunu ise ekrana yazdırmasını istiyoruz. */
else if (radioButton4.Checked == true)
MessageBox.Show(radioButton4.Text + " mezunusun.");
/* Burada üniversite mezunu ise ekrana yazdırmasını istiyoruz. */
else if (radioButton5.Checked == true)
MessageBox.Show(radioButton5.Text + " mezunusun.");
/* Burada yüksek lisans mezunu ise ekrana yazdırmasını istiyoruz. */
else if (radioButton6.Checked == true)
MessageBox.Show(radioButton6.Text + " mezunusun.");
Not: radioButton1.Text kullanmamın sebebi siz radioButton'un yazısına ne yazarsanız onu göstermesini amaçlamakta. Ben 6 adet radioButton kullandım siz bunu daha fazla kullanabilirsiniz. Örneğin: Okumadım gibi.