minajo21(大眼睛)同志所说的也是一种办法,但作为一个程序员来将,解决问题才是上策,回避问题只有不得已而为之,况且该界面在1024*768方式下较为合适,我很想知道问题所在。
解决方案 »
- inet问题
- 如果知道一个ActiveX DLL的文件名,如何得到该DLL的ProgID?
- 寻支持多列下拉的控件又带打印功能(100分)
- 菜鸟的问题:如何让窗体随着背景图的大小变化而变化?
- 最后10分了 请问大哥们 怎么实现一个按纽让程序继续
- 有人知道网上股票软件是怎么开发的吗? 用的什么机制实现三层??不是COM+吧?
- 6月5号离职,散分!!
- sstab 控件在哪里啊? 最先告诉我的有分
- type中定义控件问题
- 请教:如何在某一个目录建一个新文件夹?如何把某一目录下文件挪到另一目录下?等...
- autorun.int 在windows2000下不好使,如何处理
- 500高分求教,高手请进!!!
你可以自己给它发个刷新消息
VB6 SP5 WINDOWSME下调 试通过
Private Sub Form_Load()
ResiZe1 Me
End Sub
'检查屏幕的分辨率确定窗体的大小----保证窗体在不同分辨率下大小近似不变
Private Function CheckRez(pixelWidth As Long, pixelHeight As Long) As Boolean Dim lngTwipsX As Long
Dim lngTwipsY As Long lngTwipsX = pixelWidth * 15
lngTwipsY = pixelHeight * 15 If lngTwipsX <> Screen.Width Then
CheckRez = False
Else
If lngTwipsY <> Screen.Height Then
CheckRez = False
Else
CheckRez = True
End If
End IfEnd Function'获取系统显示分辨率控制在不同分辨率下大小不变
'此处只列举了640X480;1024X768与800X600
'窗体在800X600时设计
'具体请应用时灵活设计
Function XRatioFun() As Single
If CheckRez(640, 480) Then
XRatioFun = 0.8ElseIf 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
theForm.Move theForm.Left * xfactor, theForm.Top * xfactor, _
theForm.Width * xfactor, theForm.Height * xfactor For Z = 0 To theForm.Controls.Count - 1 '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
theForm.Controls(Z).Move theForm.Controls(Z).Left * xfactor, _
theForm.Controls(Z).Top, theForm.Controls(Z).Width * xfactor
ElseIf TypeOf theForm.Controls(Z) Is ComboBox Then
If theForm.Controls(Z).Style <> 1 Then
theForm.Controls(Z).Move theForm.Controls(Z).Left * xfactor, _
theForm.Controls(Z).Top * xfactor, theForm.Controls(Z).Width * _
xfactor
End If
ElseIf Not theForm.Controls(Z) Is Nothing Then
theForm.Controls(Z).Move theForm.Controls(Z).Left * xfactor, _
theForm.Controls(Z).Top * xfactor, theForm.Controls(Z).Width _
* xfactor, theForm.Controls(Z).Height * xfactor 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
End If
Next ZEnd Sub
Shell "rundll32 user,repaintscreen"