Reputation: 668
Kind of new to c# GUI stuff
I am trying to output a message, a number to a textbox.
1 Button will calculate the number, then I want to write a message like " Number has been seen: "
I tried
Form2.resultBox.Text.Write("Number one has been seen: ", num0);
that doesn't work.
Also tried
Form2.resultBox += Console.WriteLine("Numer one has been seen: ", num0);
Im going to have about 16 of these messages
ideas?
Upvotes: 0
Views: 15666
Reputation: 18843
how about using the string.Format
Form2.resultBox.Text = string.Format("Number one has been seen: {0}", num0);
eliminates having to use + sign
Upvotes: 1
Reputation: 1283
To set the value of a TextBox, you should set a value on the Text property like so:
resultBox.Text = "Number one has been seen: " + num;
Upvotes: 1