richbox에서 버튼누를때 글자색 변경하도록 하는 방법
01private void richTextBox1_KeyDown(object sender, KeyEventArgs e)
02{
03    switch (e.KeyCode)
04    {
05        case Keys.NumPad1:
06        case Keys.D1:
07            richTextBox1.SelectionStart = richTextBox1.Text.Length;
08            richTextBox1.SelectionLength = 1;
09            richTextBox1.SelectionColor = Color.Red;
10            break;
11        case Keys.NumPad2:
12        case Keys.D2:
13            richTextBox1.SelectionStart = richTextBox1.Text.Length;
14            richTextBox1.SelectionLength = 1;
15            richTextBox1.SelectionColor = Color.Yellow;
16            break;
17        case Keys.NumPad3:
18        case Keys.D3:
19            richTextBox1.SelectionStart = richTextBox1.Text.Length;
20            richTextBox1.SelectionLength = 1;
21            richTextBox1.SelectionColor = Color.Blue;
22            break;
23        default:
24            richTextBox1.SelectionStart = richTextBox1.Text.Length;
25            richTextBox1.SelectionLength = 1;
26            richTextBox1.SelectionColor = Color.Black;
27            break;
28    }
29}
- 개발자 커뮤니티 사이트 (http://www.sky.ph) -
Posted by 아르다