محاسبه فوت و اینچ
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 WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public double conv(ref double s)
{
if (radioButton1.Checked )
s = s * 0.3048;
if (radioButton2.Checked )
s = s * 0.0254;
}
private void button1_Click(object sender, EventArgs e)
{
double s = Convert.ToDouble(textBox1.Text);
conv (ref s);
label1.Text = s.ToString();
label2.Text = (s * 100).ToString();
}
private void label3_Click(object sender, EventArgs e)
{
}
}
}
نظرات شما عزیزان: