我想在RichTextBox中绘制单词和段落的边框,但是当我打开UserPaint时,它不再绘制文本,而我的自定义绘画似乎可以工作。也许我忘记打开其他东西了吗?这是我的代码:
public partial class RichTextBoxEx : RichTextBox
{
public RichTextBoxEx()
{
InitializeComponent();
SetStyle(ControlStyles.UserPaint, true);
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
//Do some painting here
}
}
参考这个问题的信息并没有帮助到我。