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 NGToolsPC { public partial class frmInputNGCom : Form { public frmInputNGCom() { InitializeComponent(); } private void OK_Button_Click(object sender, EventArgs e) { if (Math.Abs((double.Parse(ngzf1.textbox22.Text)) - 100) > 0.001) { MessageBox.Show("天然气组分之和不等于100!"); this.ngzf1.Select(); return; } else { frmNgTools. frmNG.setZf(ngzf1.CopyZf().Replace("~", "_")); this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } } private void frmInputNGCom_Load(object sender, EventArgs e) { String temp_strXCopy = this.ngzf1.zfCopy; this.ngzf1.PasteZf(ref temp_strXCopy); this.ngzf1.zfCopy = temp_strXCopy; } private void Cancel_Button_Click(object sender, EventArgs e) { this.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.Close(); } private void ListBox1_SelectedIndexChanged(object sender, EventArgs e) { ngzf1.zfCopy = "0~0~0~0~0~0~0~0~0~0~0~0~0~0~0~0~0~0~0~0~0~0~0~0~0~0~0~0~0~0~0~0~0~0~0~0~0"; String temp_strXCopy = ngzf1.zfCopy; ngzf1.PasteZf(ref temp_strXCopy); ngzf1.zfCopy = temp_strXCopy; switch (ListBox1.SelectedIndex) { case 0: ngzf1.zfCopy = "88.36~0.68~1.57~6.25~2.4~0~0~0.04~0~0~0.15~0.35~0.1~0.05~0.01~0~0~0~0~0.04~0"; String temp_strXCopy2 = ngzf1.zfCopy; this.ngzf1.PasteZf(ref temp_strXCopy2); ngzf1.zfCopy = temp_strXCopy2; break; case 1: ngzf1.zfCopy = "92.47~1.75~0.68~3.5~0.98~0~0~0~0~0~0.34~0.22~0.06~0~0~0~0~0~0~0~0"; String temp_strXCopy3 = ngzf1.zfCopy; this.ngzf1.PasteZf(ref temp_strXCopy3); ngzf1.zfCopy = temp_strXCopy3; break; case 2: ngzf1.zfCopy = "96.5~0.3~0.6~1.8~0.45~0~0~0~0~0~0.1~0.1~0.05~0.03~0.07~0~0~0~0~0~0"; String temp_strXCopy4 = ngzf1.zfCopy; this.ngzf1.PasteZf(ref temp_strXCopy4); ngzf1.zfCopy = temp_strXCopy4; break; case 3: ngzf1.zfCopy = "90.7~3.1~0.5~4.5~0.84~0~0~0~0~0~0.1~0.15~0.03~0.04~0.04~0~0~0~0~0~0"; String temp_strXCopy5 = ngzf1.zfCopy; this.ngzf1.PasteZf(ref temp_strXCopy5); ngzf1.zfCopy = temp_strXCopy5; break; case 4: ngzf1.zfCopy = "85.9~1~1.5~8.5~2.3~0~0~0~0~0~0.35~0.35~0.05~0.05~0~0~0~0~0~0~0"; String temp_strXCopy6 = ngzf1.zfCopy; this.ngzf1.PasteZf(ref temp_strXCopy6); ngzf1.zfCopy = temp_strXCopy6; break; case 5: ngzf1.zfCopy = "73.5~10~1.6~3.3~0.74~0~~9.5~1~0~0.12~0.12~0.04~0.04~0.02~0.01~0.01~0~0~0~0"; String temp_strXCopy7 = ngzf1.zfCopy; this.ngzf1.PasteZf(ref temp_strXCopy7); ngzf1.zfCopy = temp_strXCopy7; break; case 6: ngzf1.zfCopy = "81.2~5.7~7.6~4.3~0.9~0~0~0~0~0~0.15~0.15~0~0~0~0~0~0~0~0~0"; String temp_strXCopy8 = ngzf1.zfCopy; this.ngzf1.PasteZf(ref temp_strXCopy8); ngzf1.zfCopy = temp_strXCopy8; break; case 7: ngzf1.zfCopy = "82.6~11.7~1.1~3.5~0.75~0~0~0~0~0~0.12~0.12~0.04~0.04~0.02~0.01~0~0~0~0~0"; String temp_strXCopy9 = ngzf1.zfCopy; this.ngzf1.PasteZf(ref temp_strXCopy9); ngzf1.zfCopy = temp_strXCopy9; break; } } } }