0

Radiobutton ve Checkbox Örneği

Radiobutton ve Checkbox Örneği için tıklayınız.

radio

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 radio_checkbox
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
string spor = “”;
if (checkBox1.Checked)
{
spor = spor + checkBox1.Text+”\r\n”;
}
if (checkBox2.Checked)
{
spor = spor + checkBox2.Text + “\r\n”;
}
if (checkBox3.Checked)
{
spor = spor + checkBox3.Text + “\r\n”;
}
if (checkBox4.Checked)
{
spor = spor + checkBox4.Text + “\r\n”;
}
if (checkBox5.Checked)
{
spor = spor + checkBox5.Text + “\r\n”;
}
MessageBox.Show(spor);
}

private void button2_Click(object sender, EventArgs e)
{
string spor = “”;
if (radioButton1.Checked)
{
spor = radioButton1.Text;
}
else if (radioButton2.Checked)
{
spor = radioButton2.Text;
}
else if (radioButton3.Checked)
{
spor = radioButton3.Text;
}
else if (radioButton4.Checked)
{
spor = radioButton4.Text;
}
else if (radioButton5.Checked)
{
spor = radioButton5.Text;
}
MessageBox.Show(spor);
}
}
}

admin

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir