C#Winform-表格高度 [英] c# winform - form height

查看:171
本文介绍了C#Winform-表格高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我的其中一个表单的高度很高,因此使用笔记本电脑的用户看不到表单底部的控件.
但是屏幕较大的用户很好,可以看到表格的整个高度.
表单是可调整大小的,但是没有任何区别.他们仍然看不到窗体底部的控件.
对于使用小型笔记本电脑的用户而言,请问如何解决?
感谢

Hi,
The height of one of my forms is high so that users with laptops do not see the controls at the bottom of the form.
But the users with bigger screens are fine and can see the full height of the form.
The form is resizable but that does not make a difference. Still they do not see the controls at the bottom of the form.
What is the solutioin for the users with small laptops please?
Thanks

推荐答案

您可以执行许多操作:最简单的方法是通过AutoScroll属性启用表单上的滚动条.

接下来是查看Anchor属性.这使您可以设置表单控件的哪一边(如果使用匹配对,例如顶部和底部),以及控件的位置和大小.

然后,有一种更复杂的方法,使用面板将控件作为组包含,并根据需要调整面板的大小和位置.
There are a number of things you can do: The simplest is to enable a scroll bar on the form, via the AutoScroll property.

The next is to look at the Anchor property. This allows you to set which side(s) of the form control the location (and size if you use matching pairs, e.g. Top and Bottom) of a control.

Then there is a more complex method using panels to contain controls as groups, and resize and relocate the panels as required.


不仅使表单可调整大小",而且还应用了以下内容:

1,FlowLayoutPanel会将您的子控件从左到右放置,并在空间不足时自动移动到新行.这对于流畅的设计非常有用,因为它会根据可用空间来调整布局.
http://msdn.microsoft.com/en-us/library/f9e8s203.aspx [ ^ ]

2,Control.Anchor属性允许子控件根据窗体工作区的大小来更改位置和大小.因此,使控件始终与右侧或底部边缘保持固定的偏移量.

3,Control.Dock属性将子控件放置在边缘上,相反的大小将由包含的表单自动定义.

http://msdn.microsoft.com/en-us/library/ms171633.aspx [ ^ ]


这样,您可以提供更加流畅的布局,其中布局会根据可用空间进行更改.
Not only make your form ''resizable'' but also apply the following:

1, FlowLayoutPanel will position your child controls from left to right and automatically move to a new row when you run out of space. This is great for a fluid design as it will adjust the layout depending on the available space.
http://msdn.microsoft.com/en-us/library/f9e8s203.aspx[^]

2, Control.Anchor property allows a child control to alter position and size based on the size of the form client area. So you make your control always be a fixed offset from the right or bottom edges.

3, Control.Dock property will position a child control against an edge and the opposite size will automatically be defined by the containing form.

http://msdn.microsoft.com/en-us/library/ms171633.aspx[^]


This way you provide a more fluid layout where the layout changes based on the available space.


这篇关于C#Winform-表格高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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