'********************************************************* '* 名称:FormSet(formname,mode) '* 功能:此函数用于初始化窗体的大小和位置 '* 用法:mode 满屏(0),左上(1),右上(2),左下(3),右下(4),居中(5) '********************************************************* Public Function FormSet(F As Form, Nu As Integer) As String Dim BarHeight As Integer '任务条的高度 BarHeight = 27 * 15 If IsNull(Nu) Then Nu = 0 End If F.ScaleMode = 3 '将窗体的分辨率设为象素级 Select Case Nu '根据参数设置窗体的大小和位置 Case 0 '默认的窗体效果,最大化 With F .top = 0 .Left = 0 .Width = Screen.Width .Height = Screen.Height - BarHeight End With Case 1 '窗体的位置居左上 With F .top = 0 .Left = 0 End With Case 2 '窗体的位置居右上 With F .top = 0 .Left = Screen.Width - .Width End With Case 3 '窗体的位置居左下 With F .top = Screen.Height - .Height - BarHeight .Left = 0 End With Case 4 '窗体的位置居右下 With F .top = Screen.Height - .Height - BarHeight .Left = Screen.Width - .Width End With Case 5 '窗体的位置居中 With F .top = (Screen.Height - .Height) / 2 .Left = (Screen.Width - .Width) / 2 End With End Select
MDIForm.Move left, top, width, heightleft 必需的。指定 MDIForm 左边的水平坐标 (x-轴)。
top 可选的。指定 MDIForm 顶边的垂直坐标 (y-轴)。
width 可选的。指定 MDIForm 新的宽度。
height 可选的。指定 MDIForm 新的高度。
Form1.move 0,0,0,0
'* 名称:FormSet(formname,mode)
'* 功能:此函数用于初始化窗体的大小和位置
'* 用法:mode 满屏(0),左上(1),右上(2),左下(3),右下(4),居中(5)
'*********************************************************
Public Function FormSet(F As Form, Nu As Integer) As String
Dim BarHeight As Integer '任务条的高度
BarHeight = 27 * 15
If IsNull(Nu) Then
Nu = 0
End If
F.ScaleMode = 3 '将窗体的分辨率设为象素级
Select Case Nu '根据参数设置窗体的大小和位置
Case 0 '默认的窗体效果,最大化
With F
.top = 0
.Left = 0
.Width = Screen.Width
.Height = Screen.Height - BarHeight
End With
Case 1 '窗体的位置居左上
With F
.top = 0
.Left = 0
End With
Case 2 '窗体的位置居右上
With F
.top = 0
.Left = Screen.Width - .Width
End With
Case 3 '窗体的位置居左下
With F
.top = Screen.Height - .Height - BarHeight
.Left = 0
End With
Case 4 '窗体的位置居右下
With F
.top = Screen.Height - .Height - BarHeight
.Left = Screen.Width - .Width
End With
Case 5 '窗体的位置居中
With F
.top = (Screen.Height - .Height) / 2
.Left = (Screen.Width - .Width) / 2
End With
End Select
End Function
me.top=
me.left=
end sub