当我移动(调整大小)窗体或组件时,我需要暂停刷新 [英] I Need To Suspend Refreshing When I Move (Resize) Form Or Component

查看:119
本文介绍了当我移动(调整大小)窗体或组件时,我需要暂停刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我调整其他控件的大小时,我有问题,我有一个N点添加到我的图表的系列,然后我画一条线

 graph.DrawLine( new  Pen(Color.Yellow, 1 ),point3,point4); 

当我调整其他控件的大小时o de形成这条线消失,然后当我在图表中再次出现时。我需要避免消失。



解决方案:我用boolean var调用post paint并重新绘制线条。

解决方案

显然,你做错了。您必须通过在重写的 OnPaint 方法或 Paint 处理程序中进行所有渲染来永久支持绘图/重绘。有关详细信息,请参阅我过去的答案:

什么样的俏皮方法是Paint? (DataGridViewImageCell.Paint(...)) [ ^ ],

如何避免DatagridView C#中的红十字[ [ ^ ],

在面板上捕获绘图 [ ^ ],

< a href =http://www.codeproject.com/Answers/195499/Drawing-Lines-between-mdi-child-forms#answer3> mdi子表单之间的绘制线 [ ^ ]。



-SA

I have problem whit the chart when i resize other controls, i have a seri with N point added to my chart, then i paint a line

graph.DrawLine(new Pen(Color.Yellow, 1), point3, point4);

when i resize other control o de form this line disapear, then when i zom in the chart appear again. I need to avoid disapear.

SOLUTION: I call post paint with boolean var and repaint the lines.

解决方案

Apparently, you are doing it wrong. You have to support drawing/redrawing permanently, by doing all rendering in your overridden OnPaint method or Paint handler. For further detail, please see my past answers:
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[^],
How to avoid Red Cross in DatagridView C#[^],
capture the drawing on a panel[^],
Drawing Lines between mdi child forms[^].

—SA


这篇关于当我移动(调整大小)窗体或组件时,我需要暂停刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆