Reputation: 31
I have been trying to get a rich text box to display the current cpu usage from a variable I created when I click a button, but does not work when I use .appendText because it is an int could anyone show me how to do this?
private void button2_Click(object sender, EventArgs e)
{
}
Upvotes: 0
Views: 1759
Reputation: 6032
The AppendText
-method only accepts parameters of type string
. So you have to convert your int
-variable .ToString()
.
private void button2_Click(object sender, EventArgs e)
{
RichTextBox1.AppendText(yourVariable.ToString());
}
Upvotes: 2