Sub SetDeviceIndependentWindow(TheForm As Form)
Dim DesignX% Dim DesignY% Dim XFactor As Single Dim YFactor As Single Dim Z As Integer XFactor = Screen.Width / 9600 YFactor = Screen.Height / 7200 If XFactor = 1 And YFactor = 1 Then Exit Sub End If TheForm.Move = TheForm.Left * XFactor, TheForm.Top * YFactor, _ TheForm.Width * XFactor, TheForm.Height * YFactor For Z = 0 To TheForm.Controls.Count - 1 'If TypeOf TheForm.Controls(Z) Is CommonDialog Then If TypeOf TheForm.Controls(Z) Is Timer Then ElseIf 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 * YFactor 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 * YFactor, TheForm.Controls(Z).Width * XFactor End If Else TheForm.Controls(Z).Move TheForm.Controls(Z).Left * XFactor, _ TheForm.Controls(Z).Top * YFactor, TheForm.Controls(Z).Width * _ XFactor, TheForm.Controls(Z).Height * YFactor 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 Z End Sub |