调整表单大小 [英] Resizing a form

查看:76
本文介绍了调整表单大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好


我有一点问题。


我如何确保图表不会重新绘制图表

正在调整大小?

我试图在form1上添加一个鼠标上/下事件处理程序,但它是

dosn'调整大小时调用:(


我希望能够调整我的表单大小,但也要确保图形是

仅在重新绘制时重新绘制用户不再调整大小。


希望我的问题有意义:)


-

S? ren Reinke
www.Xray-Mag.com/ - 免费在网上潜水杂志。

当前问题在北美潜水,99页。

下载PDF格式

Hi there

I have a little problem.

How do i make sure that a graph is not redrawn while the form with the graph
is being resized ?
I have tried to add a mouse up/down event handler on the form1, but it
dosn''t get called when resizing :(

I would like to be able to resize my form, but also make sure the graph is
only redrawn when the user is not resizing any more.

Hope my question make sense :)

--
S?ren Reinke
www.Xray-Mag.com/ - Your free diving magazin on the net.
Current issue Diving in North America, 99 pages.
Download it in PDF

推荐答案

S?ren Reinke写道:
S?ren Reinke wrote:
你好

我有一点问题。

我如何确定图表没有重绘正在调整图表的形式

我试图在form1上添加一个鼠标上/下事件处理程序,但它在调整大小时不会被调用:(

我希望能够调整表单的大小,同时确保图表仅在用户不再调整大小时才重新绘制。

希望我的问题是有道理的:)
Hi there

I have a little problem.

How do i make sure that a graph is not redrawn while the form with the graph
is being resized ?
I have tried to add a mouse up/down event handler on the form1, but it
dosn''t get called when resizing :(

I would like to be able to resize my form, but also make sure the graph is
only redrawn when the user is not resizing any more.

Hope my question make sense :)




首先,重写OnResize()并在第一次输入该方法时,

你设置一个标志。你也可以调用this.SuspendLayout();,如果标志是

还没有设置。


那么,你重写OnSizeChanged。在那里,你重置标志并调用

this.ResumeLayout(false);.然后画出你的图表。


Frans


-

---------- -------------------------------------------------- ------------

获取LLBLGen Pro,.NET的高效O / R映射: http://www.llblgen.com

我的.NET博客: http://weblogs.asp.net/fbouma

Microsoft MVP(C#)

- -------------------------------------------------- ---------------------



First, override OnResize() and the first time you enter that method,
you set a flag. You also call this.SuspendLayout();, if the flag was
wasn''t set already.

then, you override OnSizeChanged. In there, you reset the flag and call
this.ResumeLayout(false);. Then draw your graph.

Frans

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------


" S?ren Reinke" <所以*** @ reinke.fjernmig.dk>在消息中写道

news:d5 *********** @ newsbin.cybercity.dk ...
"S?ren Reinke" <so***@reinke.fjernmig.dk> wrote in message
news:d5***********@newsbin.cybercity.dk...
我如何确保图表是否正在调整带有
图形的表单时重新绘制?

我希望能够调整表单的大小,但也要确保图表仅在重新绘制时重新绘制用户不再调整大小。
How do i make sure that a graph is not redrawn while the form with the
graph is being resized ?

I would like to be able to resize my form, but also make sure the graph is
only redrawn when the user is not resizing any more.




这取决于控件。有时会有一个BeginUpdate / EndUpdate

机制,有时你必须调用Win32 ValidateRect()函数,

传入控件的窗口句柄和客户区域。


- Alan



It depends on the control. Sometimes there is a BeginUpdate/EndUpdate
mechanism, other times you have to call the Win32 ValidateRect() function,
passing in the control''s window handle and client area.

-- Alan


>>
我希望能够调整我的表单大小,但也确保图表
仅在用户不再调整大小时才重新绘制。

希望我的问题有意义:)
I would like to be able to resize my form, but also make sure the graph
is only redrawn when the user is not resizing any more.

Hope my question make sense :)



首先,覆盖OnResize()并在第一次输入该方法时,您设置一个标志。你也可以调用this.SuspendLayout();,如果标志已经设置好了。

然后,你重写OnSizeChanged。在那里,你重置标志并调用
this.ResumeLayout(false);.然后画出你的图表。

Frans



First, override OnResize() and the first time you enter that method, you
set a flag. You also call this.SuspendLayout();, if the flag was wasn''t
set already.

then, you override OnSizeChanged. In there, you reset the flag and call
this.ResumeLayout(false);. Then draw your graph.

Frans



你好Frans


感谢您的提示,我会试试它:)


-

S?ren Reinke
www.Xray-Mag.com/ - 您在网上免费潜水杂志。

当前问题在北美潜水,99页。

下载PDF格式


Hi Frans

Thanks for the tip, i''ll try it :)

--
S?ren Reinke
www.Xray-Mag.com/ - Your free diving magazin on the net.
Current issue Diving in North America, 99 pages.
Download it in PDF


这篇关于调整表单大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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