How to change the background color of a rich text box when it is disabled?

后端 未结 6 835
庸人自扰
庸人自扰 2020-12-10 03:46

Whenever I set the RichTextBox.Enabled property to false, its background color is automatically set to gray as it is set to the color in system color which is s

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-10 04:00

    its to late but its not a bad way,

        private void richTextBox1_ReadOnlyChanged(object sender, EventArgs e)
        {
            //just here instead of White select your color
    
            richTextBox1.BackColor = Color.White;
        }
    
        private void Form1_Load(object sender, EventArgs e)
        {
            richTextBox1.ReadOnly = true;
        }
    

提交回复
热议问题