表格尺寸调整 [英] Form size adjustment
本文介绍了表格尺寸调整的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Windows 7(64位)上具有Visual Basic 2010
我有一个名为Form1的启动表单.
我编写了以下代码:
I have Visual Basic 2010 on Windows 7 (64Bit)
I have a startup form named Form1.
I have written the following code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim DeskHeight As Integer : Dim DeskWidth As Integer
DeskHeight = Screen.PrimaryScreen.Bounds.Height : DeskWidth = Screen.PrimaryScreen.Bounds.Width
Me.Show()
Me.Size = New Size(DeskWidth, DeskHeight)
Dim Location As Point : Location = New System.Drawing.Point(0, 0)
Me.Location = Location
End Sub
我的问题是屏幕底部的Windows工具栏为
以及屏幕右侧的启动工具栏(每次我启动Windows时都会加载)覆盖Form1.
如何让Form1在桌面上找到实际的可用空间
并调整大小,使其变为全屏(但尺寸略有减小),因此它不会被工具栏覆盖?
My problem is that the Windows toolbar on the bottom of the screen as
well as a startup Toolbar on the right hand of my screen (that loads every time I start Windows) cover Form1.
How can I make Form1 find the actual free space on my desktop
and resize so it becomes full screen, (but slightly reduced in size) so it is not covered by the toolbars ?
推荐答案
它被称为最大化".只需为表单设置适当的属性.
It''s call "maximizing". Just set the appropriate property for the form.
me.WindowState = FormWindowState.Maximized
或使用:
Or use:
DeskWidth = Screen.PrimaryScreen.WorkingArea.Width
DeskHeight = Screen.PrimaryScreen.WorkingArea.Height
这篇关于表格尺寸调整的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文