有帮助吗?

解决方案 2

此行为似乎是因为我的的OnPaint函数e.g内更新所述用户控件的区域。

protected override void OnPaint ( PaintEventArgs e )
{
    // Update Region here

    base.OnPaint( e );
}

这显然导致控制无效本身和再拉深本身克服这个我已经使用:

Graphics g = e.Graphics;
g.SetClip( Region, CombineMode.Intersect );

这然后可以用于疼痛的不透明效果夹,同时允许内容来绘图。

其他提示

作为一个经验法则,.Invalidate()通常比.REFRESH(更好),因为.REFRESH()会导致立即重绘,所以如果你把它叫做两次,被做了两个重绘。我不认为它会帮助你在这里多,虽然。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top