I wrote this function
    private void richAdd(string who, string what)
    {
        string colorstring = who + " ( " + DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss") + " ) :";
        richTextBox1.Text += colorstring + " " + what + "\r\n\r\n";
richTextBox1.DeselectAll();
        richTextBox1.Select(richTextBox1.Find(colorstring), colorstring.Length);
        richTextBox1.SelectionColor = Color.Blue;
richTextBox1.DeselectAll();
    }
which is supposed to color who+time in blue and what in black.
Yet after the second time i开发者_如何学Pythont makes all the text blue... any ideas what could be wrong with it?
Thanks!
try
    private void richAdd(string who, string what)
    {
        string colorstring = who + " ( " + DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss") + " ) :";
        richTextBox1.AppendText(colorstring + " " + what + "\r\n\r\n");
        richTextBox1.Select(richTextBox1.Text.LastIndexOf(colorstring), colorstring.Length);
        richTextBox1.SelectionColor = Color.Blue;
    }
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论