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

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

Cl         


        
2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-28 09:00

    You could do something like string formatting to help space the strings with spaces.

    something like

    richTextBox1.Text = String.Format("This is the number of A in B: {0}\r\n This is the number of X in Y: {1}", output1, output2);
    

    \r\n indicates a new line, you can find more information about the String.Format() method on msdn: https://msdn.microsoft.com/en-us/library/system.string.format(v=vs.110).aspx

提交回复
热议问题