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);
Loading

VulpesPosted Aug 21, 2014, 7:33 AM
http://msdn.microsoft.com/en-us/library/bb397750(v=vs.110).aspx
Unlike user settings, application settings can only be created or changed at compile time.
If the defaults will never change, you could hard-code the values in the Properties Box or, at runtime in Form_Load, rather than bother with settings.
Farhan ShariffPosted Aug 21, 2014, 7:19 AM
VulpesPosted Aug 21, 2014, 5:46 AM
However, you could then have user settings whereby individual users could override these defaults. As user settings are writable from the application itself, the user could be given the opportunity to save them at runtime.