richbox에서 버튼누를때 글자색 변경하도록 하는 방법
private void richTextBox1_KeyDown(object sender, KeyEventArgs e)
{
    switch (e.KeyCode)
    {
        case Keys.NumPad1:
        case Keys.D1:
            richTextBox1.SelectionStart = richTextBox1.Text.Length;
            richTextBox1.SelectionLength = 1;
            richTextBox1.SelectionColor = Color.Red;
            break;
        case Keys.NumPad2:
        case Keys.D2:
            richTextBox1.SelectionStart = richTextBox1.Text.Length;
            richTextBox1.SelectionLength = 1;
            richTextBox1.SelectionColor = Color.Yellow;
            break;
        case Keys.NumPad3:
        case Keys.D3:
            richTextBox1.SelectionStart = richTextBox1.Text.Length;
            richTextBox1.SelectionLength = 1;
            richTextBox1.SelectionColor = Color.Blue;
            break;
        default:
            richTextBox1.SelectionStart = richTextBox1.Text.Length;
            richTextBox1.SelectionLength = 1;
            richTextBox1.SelectionColor = Color.Black;
            break;
    }
}
- 개발자 커뮤니티 사이트 (http://www.sky.ph) -
Posted by 아르다