N
News charter
I'm playing with MS Visual Studio C#
I have a Combo box that drops down to let me pick a quantity value. called
milkQnty
However, my understanding is that C# treats this as an object.
I want to use this value to multiply with the price to get the total.
double milkPrice, milkTotal;
milkPrice = 1.99f;
milkTotal = milkPrice * milkQnty;
When I compile, I get a message that says I cannot apply operands of type
System.Windos.Forms.ComboBox; and 'double'
How can I turn the value in object milkQnty into an integer I can do
arithmetic with ?
Trying to learn C# and this is all new to me.
Thanks in advance.
I have a Combo box that drops down to let me pick a quantity value. called
milkQnty
However, my understanding is that C# treats this as an object.
I want to use this value to multiply with the price to get the total.
double milkPrice, milkTotal;
milkPrice = 1.99f;
milkTotal = milkPrice * milkQnty;
When I compile, I get a message that says I cannot apply operands of type
System.Windos.Forms.ComboBox; and 'double'
How can I turn the value in object milkQnty into an integer I can do
arithmetic with ?
Trying to learn C# and this is all new to me.
Thanks in advance.