最大化表格宽度,但保持高度vb.net [英] Maximize form width but maintain height vb.net
本文介绍了最大化表格宽度,但保持高度vb.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我需要最大化表单,但仅靠屏幕的宽度即可,并且它具有固定的高度.并且也像任务栏一样位于顶部.
你能帮助我吗?谢谢!
Hi All,
I need to maximize a form but only by the screen''s width and it has a fixed height. and also be positioned on topmost like a taskbar on top.
Can you help me? Thanks!
推荐答案
此代码应能解决问题:
This code should do the trick:
Private Sub Form1_Load(sender As Object, e As EventArgs)
Me.Location = New Point(0, 0)
Me.Width = Screen.PrimaryScreen.WorkingArea.Width
End Sub
您可以指定如何控件通过使用其属性来填充表单.如果这还不够好,则需要编写代码来放置控件.您可以为表单指定最小和最大高度属性,如果属性相同,则会阻止人们调整表单的大小.
You can specify how your controls grow to fill a form using their properties. If that''s not good enough, you need to write code to position your controls. You can specify a min and max height property for the form, which, if they are the same, will stop people resizing the form.
这篇关于最大化表格宽度,但保持高度vb.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文