Farhan Shariff

Farhan Shariff

  • NA
  • 933
  • 242.1k

Default Value to textbox

Aug 21 2014 5:30 AM
i have application with numeric double textbox I want to provide default values(ideal values) to these text box when application starts
and user should also be able to change them 


                bool comparisonCompleted;
                comparisonCompleted = false;


                double num;
                bool isNum = double.TryParse(textBox1.Text, out num);


                double num1;
                bool isNum1 = double.TryParse(textBox2.Text, out num1);


                double num2;
                bool isNum2 = double.TryParse(textBox3.Text, out num2);




                if (!((isNum) || (isNum1) || (isNum2)))
                {
                    MessageBox.Show("Enter Only Numeric +ve Double Values for Boundary Conditions  " + "\n" + " ", "Critical Input Error- Application will Exit ", MessageBoxButtons.OK, MessageBoxIcon.Error);


                }




                double delta_sigma_critical = double.Parse(textBox1.Text);//ideal value =1.5
                Convert.ToDouble(delta_sigma_critical);


         
                double Non_critical_cpk = double.Parse(textBox2.Text);//ideal value =6
                Convert.ToDouble(Non_critical_cpk);


             
                double critical_cpk = double.Parse(textBox3.Text);//Ideal value = 1.6
                Convert.ToDouble(critical_cpk);


               

Answers (3)