请问怎样在 鼠标移动的时候触发 OnPaint(PaintEventArgs e)?

thankuu 2003-10-20 12:57:22
有以下两个void,一个鼠标移动的,一个是画图的,我现在想鼠标移动的时候触发 OnPaint(PaintEventArgs e), 请问怎样实现?

protected override void OnMouseMove(MouseEventArgs e)
{
...........
}

protected override void OnPaint(PaintEventArgs e)
{
................
}
...全文
145 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
danialxie 2003-10-27
  • 打赏
  • 举报
回复
如下
protected override void OnMouseMove(MouseEventArgs e)
{
Graphics f = this.CreateGraphics ();
System.Drawing .Rectangle cliprect = new Rectangle (0,0,ClientSize.Width ,ClientSize.Height);
this.OnPaint(new System.Windows.Forms.PaintEventArgs(f,cliprect));
}
zag 2003-10-20
  • 打赏
  • 举报
回复
protected override void OnMouseMove(MouseEventArgs e)
{
...........
this.update();
}

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧