代码:
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 bt
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)//标签1,用于显示人民币
{
}
private void label2_Click(object sender, EventArgs e)//标签2,用于显示汇率
{
}
private void label3_Click(objectsender,EventArgs e) //标签3,用于显示美元
{
}
private void textBox1_TextChanged(objectsender, EventArgs e)//文本框1,用于输入人民币
{
}
private void textBox2_TextChanged(object sender, EventArgs e) //文本框2,用于输入汇率
{
}
private void textBox3_TextChanged(object sender, EventArgs e) //文本框3,用于输入美元
{
}
private void b1_Click(object sender,EventArgs e) //按钮1清屏函数。
{
t1.Text = "";
t2.Text = "";
t3.Text = "";
}
private void b2_Click(object sender,EventArgs
e) //按钮2¥-$转换
{ t3.Text=Convert.ToString(Convert.ToDouble(t1.Text) / Convert.ToDouble(t2.Text));
}
private void b3_Click(objectsender,EventArgse) //按钮3$-¥转换
{
t1.Text=Convert.ToString(Convert.ToDouble(t3.Text) * Convert.ToDouble(t2.Text));
}
private void b4_Click(objectsender,EventArgs e) //退出按钮
{
Application.Exit();
}
}
}
C#实验课:人民币和美元兑换
最新推荐文章于 2024-06-14 15:44:05 发布