本文介绍了表单根据屏幕大小调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 您好, 当我在笔记本上开始申请时遇到问题。 一个窗口形式太大了屏幕,它没有完整显示。 这是因为高度太长,我想。 我也做了一个简单的测试只需要一个表格来检查。我这样做了: 拉伸形式下行的底部边缘,因为它比我的屏幕长得多。 然后运行它。你会看到表格在外面。 但是我希望看到这个,表单会自行调整大小,所有控件也会调整自己的大小以适应任何新的屏幕。 我网络搜索机没有找到任何帮助。有人说要让窗户最大化,但是我尝试了这个,并没有发生任何变化。 我现在想的是锚和停靠,但它们不只是用于控制吗? 如何解决这个问题? 提前谢谢!Hello,I meet a problem when I start my application on a notebook.One windows form is too big for the screen and it is not complete shown.It''s because the height is too long, I think.And I made also a simple test with just one form to check this. I did this:stretch the buttom edge of the form downsides as far as it is much longer as my screen.And then just run it. You''ll see the form is outside.But I expect to see that, the form resizes itself and all controls also resize themself to fit any new screens.I didn''t find any help with net searching machines. Some say to make the windows as maximized, but I tried this, and no changes happened.I currently think about "anchor" and "dock", but are they not just for controls?How can I solve this?Thank you in advance!推荐答案表单启动后,需要计算屏幕大小,然后调整表单大小。如果所有内部控件已经自己调整大小,它们将在重新定位主窗体之后。除非最大化,否则通常没有任何内容可以自动使表单适合屏幕,因此如果显示正常,则必须自己执行此操作。通常,您认为窗口是最大化,最小化或正常。没有要求正常位置的窗口适合屏幕 - 您必须使其适合屏幕。Once the form is up, you need to calculate screen size, and then adjust the form size. If all the internal controls already resize themselves, they will after the main form is repositioned. There is usually nothing to autmaticlaly make the form fit the screen unless it is ''maximized'', so you have to do that yourself if it is showing ''normally''. Typically, you think of a window as being ''Maximized'', ''Minimized'', or ''Normal''. There is no requirement that a window in ''Normal'' position will fit the screen - you must MAKE it fit the screen. 这篇关于表单根据屏幕大小调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-04 07:39
查看更多