How do you retrieve values in a TextBox to make calculations? If I am not mistaken, if you retrieve a value from a TextBox then these values are characters/string?
How do you retrieve values in a TextBox to make calculations? If I am not mistaken, if you retrieve a value from a TextBox then these values are characters/string?
Convert Textbox's value into the integer. I know about C language and in that atoi is expected to do this. However I doubt about your application.
But when I do:
I have a compilation error "Can not implicitly convert string to int"Code:int x = 3 * (int)TextBox1.Text;
Error 1 Can not convert type 'string' to 'int'
I suppose you are using C# which is more like Java. If I am correct than there is a constructor "new Integer (String)" or a static method in class "Integer" that you can use to convert String value to Integer value.
Hey I got the solution. Thanks sergioKomic, it reminds me this:
Anyways thanks.Code:int x = Convert.ToInt32 (TextBox1.Text);
Bookmarks