Gerekli araçlar
/* Bay seçiliyse Hoşgeldin adın,soyadın yazdırmasını istiyoruz */
if (radioButton1.Checked)
MessageBox.Show("Hoşgeldin Bay" + textBox1.Text + " " + textBox2.Text);
/* Bayan seçiliyse Hoşgeldin adın,soyadın yazdırmasını istiyoruz */
else if (radioButton2.Checked)
MessageBox.Show("Hoşgeldin Bayan" + textBox1.Text + " " + textBox2.Text);
Not: Mesaj kutusu içinde alternatif yöntem ile bay veya bayan kısmını şöyle yazdırabilirsiniz;
/* Burada radioButton'a yazdığınız yazı gözükecektir.(Bay) */
MessageBox.Show("Hoşgeldin "+ radioButton1.Text + " " + textBox1.Text + textBox2.Text);
/* Burada radioButton'a yazdığınız yazı gözükecektir.(Bayan) */
MessageBox.Show("Hoşgeldin "+ radioButton2.Text + " " + textBox1.Text + textBox2.Text);
- 1 adet button
- 2 adet textBox
- 2 adet radioButton
/* Bay seçiliyse Hoşgeldin adın,soyadın yazdırmasını istiyoruz */
if (radioButton1.Checked)
MessageBox.Show("Hoşgeldin Bay" + textBox1.Text + " " + textBox2.Text);
/* Bayan seçiliyse Hoşgeldin adın,soyadın yazdırmasını istiyoruz */
else if (radioButton2.Checked)
MessageBox.Show("Hoşgeldin Bayan" + textBox1.Text + " " + textBox2.Text);
Not: Mesaj kutusu içinde alternatif yöntem ile bay veya bayan kısmını şöyle yazdırabilirsiniz;
/* Burada radioButton'a yazdığınız yazı gözükecektir.(Bay) */
MessageBox.Show("Hoşgeldin "+ radioButton1.Text + " " + textBox1.Text + textBox2.Text);
/* Burada radioButton'a yazdığınız yazı gözükecektir.(Bayan) */
MessageBox.Show("Hoşgeldin "+ radioButton2.Text + " " + textBox1.Text + textBox2.Text);