Append text to the beginning in the Rich Text Box

前端 未结 3 1046
孤街浪徒
孤街浪徒 2021-01-17 13:31
private void button1_Click(object sender, EventArgs e)
{
    richTextBox1.AppendText(\"\\r\\n\");
    richTextBox1.Focus();
    string s = \"Enter \";
    richTextBo         


        
3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-17 13:56

    Simplest way i prefer is,

        private void button1_Click(object sender, EventArgs e)
        {
            richTextBox1.Text = DateTime.Now.ToString() + richTextBox1.Text;
        }
    

    It will prepend Current DateTime at Start.

提交回复
热议问题