Reputation: 37
hi i would like to ask if how to convert the Console.WriteLine to Textbox and this the line sorry im just a newbie ....thank you
Console.WriteLine(" Status: {0}", adapters[i].OperationalStatus.ToString())
Upvotes: 0
Views: 134
Reputation: 37533
I like using String.Format
as much as @Brandon and @Neil Knight do, but here's an alternative (not necessarily a better one):
myTextBox.Text = " Status: " + adapters[i].OperationalStatus.ToString();
Upvotes: 0
Reputation: 115420
You can do:
Your_TextBox.Text = String.Format("Status:{0}",
adapters[i].OperationalStatus.ToString())
http://msdn.microsoft.com/en-us/library/system.windows.controls.textbox.aspx
Upvotes: 1
Reputation: 69973
What do you mean convert Console.WriteLine to a Textbox? If you just want the Textbox to display the text, set the Text property.
TextBoxId.Text = String.Format(" Status: {0}", adapters[i].OperationalStatus.ToString());
Upvotes: 2
Reputation: 48537
TextBox.Text = String.Format(" Status: {0}", adapters[i].OperationalStatus.ToString());
Upvotes: 0