📄 mainform.cs
字号:
/*
* Created by SharpDevelop.
* User: ??
* Date: 2008-3-13
* Time: 21:10
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using cwgl;
using System.Data.SqlClient;
using cwgl.inc;
namespace cwgl
{
/// <summary>
/// Description of MainForm.
/// </summary>
public partial class MainForm : Form
{
public string l1;
public MainForm(string l1)
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
this.l1 = l1;
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
private void MainForm_Load(object sender, EventArgs e)
{
// TODO: 这行代码将数据加载到表“xmlxds.xmlx”中。您可以根据需要移动或移除它。
this.xmlxTableAdapter.Fill(this.xmlxds.xmlx);
// TODO: 这行代码将数据加载到表“xmflds.xmfl”中。您可以根据需要移动或移除它。
this.xmflTableAdapter.Fill(this.xmflds.xmfl);
}
private void button1_Click(object sender, EventArgs e)
{
zdbc addzddc = new zdbc(this.textBox13);
addzddc.ShowDialog();
}
private void button2_Click(object sender, EventArgs e)
{
cqzc addcq = new cqzc(this.textBox14);
addcq.ShowDialog();
}
private void button5_Click(object sender, EventArgs e)
{
gccb addgc = new gccb(this.textBox17);
addgc.ShowDialog();
}
private void button6_Click(object sender, EventArgs e)
{
qtzc addqt = new qtzc(this.textBox18);
addqt.ShowDialog();
}
private void button3_Click(object sender, EventArgs e)
{
tdbpzc addbp = new tdbpzc(this.textBox15, this.textBox1.Text);
addbp.ShowDialog();
}
private void button4_Click(object sender, EventArgs e)
{
crjs addcr = new crjs(this.textBox16, this.textBox1.Text);
addcr.ShowDialog();
}
private void button7_Click(object sender, EventArgs e)
{
this.textBox1.Text = " ";
this.textBox2.Text = "0";
this.textBox3.Text = "0";
this.textBox6.Text = "0";
this.textBox8.Text = "0";
this.textBox10.Text = "0";
this.textBox11.Text = "0";
this.textBox13.Text = "0";
this.textBox14.Text = "0";
this.textBox15.Text = "0";
this.textBox16.Text = "0";
this.textBox17.Text = "0";
this.textBox18.Text = "0";
this.textBox21.Text = "0";
this.textBox22.Text = " ";
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
try
{
if (float.Parse(textBox2.Text.ToString().Trim()) >= 0)
{
float t1 = float.Parse(textBox2.Text.ToString().Trim());
float t2 = float.Parse(textBox3.Text.ToString().Trim());
float t3 = t1 * t2;
textBox4.Text = t3.ToString().Trim();
}
else
{
MessageBox.Show("请输入正整数","提示");
this.textBox2.Text = "0";
}
}
catch (FormatException e1)
{
MessageBox.Show("请输入数字", "提示");
this.textBox2.Text = "0";
}
}
private void textBox3_TextChanged(object sender, EventArgs e)
{
try
{
if (float.Parse(textBox3.Text.ToString().Trim()) >= 0)
{
float t1 = float.Parse(textBox2.Text.ToString().Trim());
float t2 = float.Parse(textBox3.Text.ToString().Trim());
float t3 = t1 * t2;
textBox4.Text = t3.ToString().Trim();
}
else
{
MessageBox.Show("请输入正整数", "提示");
this.textBox3.Text = "0";
}
}
catch (FormatException e1)
{
MessageBox.Show(e1.Message, "请输入数字");
this.textBox3.Text = "0";
}
}
private void textBox4_TextChanged(object sender, EventArgs e)
{
try
{
float t1 = float.Parse(textBox4.Text.ToString().Trim());
float t2 = float.Parse(textBox21.Text.ToString().Trim());
float t3 = float.Parse(textBox6.Text.ToString().Trim());
float t4 = t1 - t2;
float t5 = t1 - t3;
textBox5.Text = t4.ToString().Trim();
textBox7.Text = t5.ToString().Trim();
}
catch (FormatException e1)
{
MessageBox.Show("请输入数字", "提示");
this.textBox4.Text = "0";
}
}
private void textBox21_TextChanged(object sender, EventArgs e)
{
try
{
if (float.Parse(textBox21.Text.ToString().Trim()) >= 0)
{
float t1 = float.Parse(textBox4.Text.ToString().Trim());
float t2 = float.Parse(textBox21.Text.ToString().Trim());
float t3 = t1 - t2;
textBox5.Text = t3.ToString().Trim();
}
else
{
MessageBox.Show("请输入正整数","提示");
this.textBox21.Text = "0";
}
}
catch (FormatException e1)
{
MessageBox.Show("请输入数字", "提示");
this.textBox21.Text = "0";
}
}
private void textBox6_TextChanged(object sender, EventArgs e)
{
try
{
if (float.Parse(textBox6.Text.ToString().Trim()) >= 0)
{
float t1 = float.Parse(textBox4.Text.ToString().Trim());
float t2 = float.Parse(textBox6.Text.ToString().Trim());
float t3 = t1 - t2;
textBox7.Text = t3.ToString().Trim();
}
else
{
MessageBox.Show("请输入正整数", "提示");
this.textBox6.Text = "0";
}
}
catch (FormatException e1)
{
MessageBox.Show("请输入数字", "提示");
this.textBox6.Text = "0";
}
}
private void textBox7_TextChanged(object sender, EventArgs e)
{
try
{
float t1 = float.Parse(textBox7.Text.ToString().Trim());
float t2 = float.Parse(textBox8.Text.ToString().Trim());
float t3 = t1 - t2;
textBox9.Text = t3.ToString().Trim();
}
catch (FormatException e1)
{
MessageBox.Show("请输入数字", "提示");
this.textBox7.Text = "0";
}
}
private void textBox8_TextChanged(object sender, EventArgs e)
{
try
{
if (float.Parse(textBox8.Text.ToString().Trim()) >= 0)
{
float t1 = float.Parse(textBox7.Text.ToString().Trim());
float t2 = float.Parse(textBox8.Text.ToString().Trim());
float t3 = float.Parse(textBox11.Text.ToString().Trim());
float t4 = t1 - t2;
float t5 = t2 + t3;
textBox9.Text = t4.ToString().Trim();
textBox12.Text = t5.ToString().Trim();
}
else
{
MessageBox.Show("请输入正整数","提示");
this.textBox8.Text = "0";
}
}
catch (FormatException e1)
{
MessageBox.Show("请输入数字", "提示");
this.textBox8.Text = "0";
}
}
private void textBox11_TextChanged(object sender, EventArgs e)
{
try
{
if (float.Parse(textBox11.Text.ToString().Trim()) >= 0)
{
float t1 = float.Parse(textBox8.Text.ToString().Trim());
float t2 = float.Parse(textBox11.Text.ToString().Trim());
float t3 = t1 + t2;
textBox12.Text = t3.ToString().Trim();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -