窗体大小在运行时更改 [英] Form Size Changed at Runtime

查看:87
本文介绍了窗体大小在运行时更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

观察到与表单大小有关的问题.从主应用程序中调用了一个子表单,它的大小与设计时提到的大小不同.结果,它没有在底部显示按钮来执行操作.

在附件中查找示例代码.

请在这方面帮助我.

谢谢,

Itz.Irshad

Hi Guys,

An issues is observe relevant to form size. A sub form is called from main application and it''s size differs with the size mentioned at designed time. As a result, it didn''t show the buttons at bottom to perform actions.

Find sample code in attachment.

Please, Help me in this regard.

Thanks,

Itz.Irshad

推荐答案

这是一个微妙的问题,从提供的信息来看,我可能很难找出问题所在.一种选择是调试应用程序并跟踪代码的执行情况,以找出更改表单大小的位置.另一个选择可能是订阅相关表单的SizeChanged事件,在事件处理程序中放置一个断点,然后当执行暂停在那里时,观察调用堆栈以跟踪可能更改了表单大小的代码.希望这可能对解决此问题有所帮助.
This is a subtle issue and I think from the information provided, it may be difficult to figure out where the problem is lurking. One option is to debug the application and track the execution of code to find out where the form size is getting changed. Another option may be to subscribe to the SizeChanged event of the form concerned, put a break point in the event handler and when the execution halts there, observe the callstack to track the code which might have changed the form size. Hope this may be of some help to resolve the issue.


您将有两个选择
1.您的运行时大小会更改高度和宽度.
2.您将获胜表格的自动尺寸属性设置为true,并且自动滚动属性设置为同时或垂直.


希望您的问题能解决.
You will two options
1. You runtime size change height and width.
2.You set win form auto size property is true and auto scroll property is both or vertical.


I hope your problem is solve.


亲爱的VJ Reddy和Rakesh,

感谢您的指教.
但是,我发现很简单,这全都与在主应用程序按钮单击中设置子表单的位置有关.但是...子表单尚未加载,根据获胜表单生命周期,我们应在加载后设置位置.
因此,我做了同样的事情,结果我的问题解决了.

感谢您的支持.

Itz.Irshad
Dear VJ Reddy and Rakesh,

Thanks for good advise.
But, what I figure out is simple that it is all about setting the location of sub form in main application button click. But...sub form didn''t loaded yet and according to win form life cycle, we should set location after load.
So, I do same and as a result my issue resolved.

Thanks for support.

Itz.Irshad


这篇关于窗体大小在运行时更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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