'Inserire le Declare su un modulo base
Global Const SM_CXSCREEN = 0 Global Const SM_CYSCREEN = 1 Declare Function GetSystemMetrics Lib "user32" _ (ByVal nIndex As Long) As Long Private Sub Resizeall() Dim Ctl As Control Dim X As Integer Dim Size As Double ScreenX = GetSystemMetrics(SM_CXSCREEN) ScreenY = GetSystemMetrics(SM_CYSCREEN) 'Sceglie il tipo di display. Select Case ScreenX Case 640 'size = 0.67 Size = 0.64 Case 800 Size = 0.72 Case 1024 Exit Sub Case 1280 'Exit Sub Size = 1.25 Case Else Exit Sub End Select 'Me.Height = Me.Height * size 'Me.Top = Me.Top * size 'Me.Width = Me.Width * size 'Me.Left = Me.Left * size For Each Ctl In Me.Controls Ctl.Height = Ctl.Height * Size Ctl.Width = Ctl.Width * Size Ctl.Top = Ctl.Top * Size Ctl.Left = Ctl.Left * Size If TypeOf Ctl Is TextBox _ Or TypeOf Ctl Is Label _ Or TypeOf Ctl Is CommandButton Then 'Ctl.SizeToFit Ctl.FontName = "Arial" Ctl.FontSize = 6.7 If TypeOf Ctl Is CommandButton Then Ctl.FontName = "Arial" Ctl.FontSize = 5 End If End If 'SizeToFit Next Ctl End Sub |