Sub App_Start
Reg.New1
'check and adjust the screen resolution ---------------
Reg.RootKey(Reg.rtLocalMachine)
key = "drivers\display\gpe"
If CPPC Then
logicalpixelsX=0
logicalpixelsY=0
logicalpixelsX=reg.GetValue(key, "logicalpixelsX")
logicalpixelsX=reg.GetValue(key, "logicalpixelsY")
If logicalpixelsX = 96 Then resX = 1 Else resX = logicalpixelsX/96
If logicalpixelsY = 96 Then resY = 1 Else resY = logicalpixelsX/96
Else 'PC
resX =1
resY =1
End If
'change controls
AdjustControls ("frmMain")
................
End Sub
Sub AdjustControls (FormName)
controls() = GetControls(FormName)
For i = 0 To ArrayLen(controls())-1
name = controls(i)
Control(name).Top = resY * Control(name).Top
Control(name).Left = resX * Control(name).Left
Control(name).Width = resX * Control(name).Width
Control(name).Height = resY * Control(name).Height
'Control(name).FontSize = Control(name).FontSize - seems Windows sets fonts properly itself.
Next
End Sub