C#’ta Radio Button Kullanımı
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void radioButton1_Click(object sender, EventArgs e)
{
//radio button 1 in Click’ine yazılır
int a;
double x, y, z;
textBox3.Text = “”;
textBox2.Text = “Peşin”;
a = Convert.ToInt32(textBox1.Text);
textBox4.Text = Convert.ToString(a);
x = a * 0.18;
textBox5.Text = Convert.ToString(x);
y = a + x;
textBox6.Text = Convert.ToString(y);
z = y – (y * 0.05);
textBox7.Text = Convert.ToString(z);
}
private void radioButton2_Click(object sender, EventArgs e)
{
//radio button 2 nin Click’ine yazılır
int a;
double x, y, z, b;
textBox2.Text = “Bonus”;
a = Convert.ToInt32(textBox1.Text);
textBox4.Text = Convert.ToString(a);
x = a * 0.18;
textBox5.Text = Convert.ToString(x);
y = a + x;
textBox6.Text = Convert.ToString(y);
z = y + (y * 0.05);
textBox7.Text = Convert.ToString(z);
b = z / 15;
textBox3.Text = Convert.ToString(b);
}
private void radioButton3_Click(object sender, EventArgs e)
{
//radio button 3 ün Click’ine yazılır
int a;
double x, y, z, b;
textBox2.Text = “Access”;
a = Convert.ToInt32(textBox1.Text);
textBox4.Text = Convert.ToString(a);
x = a * 0.18;
textBox5.Text = Convert.ToString(x);
y = a + x;
textBox6.Text = Convert.ToString(y);
z = y + (y * 0.10);
textBox7.Text = Convert.ToString(z);
b = z / 10;
textBox3.Text = Convert.ToString(b);
}
private void radioButton4_Click(object sender, EventArgs e)
{
//radio button 4 ün Click’ine yazılır
int a;
double x, y, z, b;
textBox2.Text = “WorldCard”;
a = Convert.ToInt32(textBox1.Text);
textBox4.Text = Convert.ToString(a);
x = a * 0.18;
textBox5.Text = Convert.ToString(x);
y = a + x;
textBox6.Text = Convert.ToString(y);
z = y + (y * 0.08);
textBox7.Text = Convert.ToString(z);
b = z / 18;
textBox3.Text = Convert.ToString(b);
}
}
}