If lngTwipsX <> Screen.Width Then
CheckRez = False
Else
If lngTwipsY <> Screen.Height Then
CheckRez = False
Else
CheckRez = True
End If
End If
End Function
'获取系统显示分辨率控制在不同分辨率下大小不变
'此处只列举了640X480;1024X768与800X600
'窗体在800X600时设计
'具体请应用时灵活设计
Function XRatioFun() As Single
If CheckRez(640, 480) Then
XRatioFun = 0.8
ElseIf CheckRez(1024, 768) Then
XRatioFun = 1.28
ElseIf CheckRez(800, 600) Then
XRatioFun = 1
Else
XRatioFun = 1
End If
End Function
'重定位窗体与其上的控件
Sub ResiZe1(theForm As Form)
Dim Z&
Dim xfactor!
xfactor = XRatioFun
'If TypeOf TheForm.Controls(Z) Is CommonDialog Then
'如果在窗体上有运行时不可见的ACTIVEX控件不要移动,比如IMAGELIST与CommonDialog等等
'If TypeOf theForm.Controls(Z) Is ImageList Then
If TypeOf theForm.Controls(Z) Is Menu Then
'菜单系统会自动处理
ElseIf TypeOf theForm.Controls(Z) Is Line Then
'直线控件不要处理
ElseIf TypeOf theForm.Controls(Z) Is DriveListBox Then
If TypeOf theForm.Controls(Z) Is TextBox Then
theForm.Controls(Z).FontSize = theForm.Controls(Z).FontSize * xfactor
ElseIf TypeOf theForm.Controls(Z) Is Label Then
theForm.Controls(Z).FontSize = theForm.Controls(Z).FontSize * xfactor
End If