private void button1_Click(object sender, EventArgs e) { Eval obU = new Eval(Convert.ToSingle(BitVal.Text), Convert.ToSingle(LoLiScale.Text), Convert.ToSingle(UpLiScale.Text), Convert.ToSingle(qvant.Text)); obU.CalcEval(); Resultt.Text = obU.sRes + ""; }
private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Enter) { e.Handled = true; Eval obT = new Eval(Convert.ToSingle(BitVal.Text), Convert.ToSingle(LoLiScale.Text), Convert.ToSingle(UpLiScale.Text), Convert.ToSingle(qvant.Text)); obT.CalcEval(); Resultt.Text = obT.sRes + ""; } }
private void Form1_Load(object sender, EventArgs e) { string ver; string[] far; ver = "v. 0.2"; label6.Text = ver; far = Environment.GetCommandLineArgs(); //BitVal.Text = ""+far.Length; stArr fae = new stArr(far); if (far.Length > 2) { BitVal.Text = far[1]; if (far.Length > 2) { LoLiScale.Text = far[2]; } if (far.Length > 3) { UpLiScale.Text = far[3]; } if (far.Length > 4) { qvant.Text = far[4]; } } //Resultt.Text = far.Length + ""; switch (far.Length) //Выбор в зависимости от количества аргументов переданных командной строке { case 1: break; case 2: break; case 3: Eval obQ = new Eval(Convert.ToSingle(far[1]), Convert.ToSingle(far[2])); obQ.CalcEval(); Resultt.Text = obQ.sRes; UpLiScale.Text = obQ.iRend + ""; qvant.Text = obQ.iCodRange + ""; break; case 4: Eval obA = new Eval(Convert.ToSingle(far[1]), Convert.ToSingle(far[2]), Convert.ToSingle(far[3])); obA.CalcEval(); Resultt.Text = obA.sRes; qvant.Text = obA.iCodRange + ""; break; case 5: Eval obB = new Eval(Convert.ToSingle(far[1]), Convert.ToSingle(far[2]), Convert.ToSingle(far[3]), Convert.ToSingle(far[4])); obB.CalcEval(); Resultt.Text = obB.sRes; break; default: break; } //end swith }
private void Form1_Load(object sender, EventArgs e) { string ver; string[] far; ver = "v. 0.2"; label6.Text = ver; far = Environment.GetCommandLineArgs(); //BitVal.Text = ""+far.Length; stArr fae = new stArr(far); if (far.Length > 2) { BitVal.Text = far[1]; if (far.Length > 2) { LoLiScale.Text = far[2]; } if (far.Length > 3) { UpLiScale.Text = far[3];} if (far.Length > 4) { qvant.Text = far[4]; } } //Resultt.Text = far.Length + ""; switch (far.Length) //Выбор в зависимости от количества аргументов переданных командной строке { case 1: break; case 2: break; case 3: Eval obQ = new Eval(Convert.ToSingle(far[1]), Convert.ToSingle(far[2])); obQ.CalcEval(); Resultt.Text = obQ.sRes; UpLiScale.Text = obQ.iRend + ""; qvant.Text = obQ.iCodRange+""; break; case 4: Eval obA = new Eval(Convert.ToSingle(far[1]), Convert.ToSingle(far[2]), Convert.ToSingle(far[3])); obA.CalcEval(); Resultt.Text = obA.sRes; qvant.Text = obA.iCodRange + ""; break; case 5: Eval obB = new Eval(Convert.ToSingle(far[1]), Convert.ToSingle(far[2]), Convert.ToSingle(far[3]), Convert.ToSingle(far[4])); obB.CalcEval(); Resultt.Text = obB.sRes; break; default: break; } //end swith }