using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace inch_santimetre
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
double inch, cm;
private void button1_Click(object sender, EventArgs e)
{
if (radioButton1.Checked == true)
{
double.TryParse(textBox1.Text,out inch);
cm = inch * 2.54;
label2.Text =inch + " İnch " + cm.ToString() + " Santimetre Eder.";
}
else if (radioButton2.Checked == true)
{
double.TryParse(textBox1.Text, out cm);
inch = cm / 2.54;
label2.Text = cm + " Santimetre " + inch.ToString() + " İnch Eder.";
}
}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
label1.Text = "İnch";
}
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
label1.Text = "Santimetre";
}
}
}
0 yorum:
Yorum Gönder