private void richTextBox1_KeyDown(object sender, KeyEventArgs e) 
...{
if (e.KeyCode == Keys.Tab) 
...{
richTextBox1.SelectedText = " ";
e.SuppressKeyPress = true;
}
}注意:
RichTextBox的AcceptsTab属性要设置为True,RichTextBox控件才可以显示Tab制表位。
上述代码在VS2008中测试通过。