How to output variables to a rich text box one after the other in c#?

后端 未结 2 1660
轻奢々
轻奢々 2021-01-28 08:31
void ClearAllRichtextboxes()
{
    richTextBox3.Clear();
    richTextBox5.Clear();
    richTextBox6.Clear();
    richTextBox9.Clear();
    richTextBox10.Clear();  
}

Cl         


        
2条回答
  •  萌比男神i
    2021-01-28 09:10

    Update the richTextBox.Text with the new information. If you want to append the new strings to what is already there use "+". You can save the string as its own variable if it helps.

    richTextBox.Text = "First segment.";  
    richTextBox.Text = richTextBox.Text + " Second segment.";  
    

    More info about string concatenation: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/strings/how-to-concatenate-multiple-strings

提交回复
热议问题