My form has textbox that holds a number for quantity. then in the textchanged event that number is placed in a label's text property with currency value (ex: $4.00). In my button click event I am trying to add all the values from the labels. When using the following code tryparse fails everytime
int num1;
string text = lbl85x11bwsub.Text;
if (int.TryParse(text, out num1))
{
MessageBox.Show(num1.ToString()); //testing
}
else
{
MessageBox.Show("it failed");
}
but if I try the same thing using the textbox's text property it works.
int num2;
if (int.TryParse(txt85x11bw.Text, out num2))
{
MessageBox.Show(num2.ToString());
}
else
{
MessageBox.Show("it failed");
}