The Text property of a TextBox is of type string, but you are trying to assign an int to it. The "ToString()" method of an object returns a string representation, so you can assign that to the Text property. It would probably be a good idea for you to go through some beginner C# tutorials to get the basic syntax and programming concepts down.
Last edited by BigEd781; December 5th, 2008 at 12:23 AM.
Also look at the String.Format(...) method, as I suspect sometimes you will want to display many variables at once:
Code:
textbox1.Text = String.Format("{0}", ten);
// output "10"
textbox1.Text = String.Format("The number is {0}", ten);
// output "The number is 10"
textbox1.Text = String.Format("My IQ is {0} and this is the end of the paragraph{1}{1}", ten * 15, Environment.NewLine);
// output "My IQ is 150 and this is the end of the paragraph" followed by 2 new lines.
hope that helps. (I took care not to use 10 in the last statement
Rob
-
Ohhhhh.... Old McDonald was dyslexic, E O I O EEEEEEEEEE.......
Bookmarks