0

Hello Dear,
i have problem to multiple two textboxs ,one is Decimal and second i didnt asign .....
Please check code..

   private void textBox18_Leave(object sender, EventArgs e)
        {

            decimal first;
            decimal second;
            decimal re;
            var b1 = decimal.TryParse(textBox18.Text, out first);
            var b2 = decimal.TryParse(textBox13.Text, out second);
            if (b1 && b2) re = first * second;
            textBox19.Text = re.ToString();

        }

I received error. "use of unassigned local variable 're'.

1
Contributor
1
Reply
13
Views
3 Months
Discussion Span
Last Post by zebnoon1
0
        I solved 

decimal first;
            decimal second;
            decimal re;
            var b1 = decimal.TryParse(textBox18.Text, out first);
            var b2 = decimal.TryParse(textBox13.Text, out second);
            if (b1 && b2)
            {
                re = first * second;
                textBox19.Text = re.ToString();
            }
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.