userform auto size 15-17-19-20 inç e göre

Katılım
9 Mart 2007
Mesajlar
85
Excel Vers. ve Dili
xp
userformu ve üzerindeki textbox combobox listbox vs. size monitorün 15-17-19-20-22 ye göre auto size yapabilirmiyiz
 

Haluk

Özel Üye
Katılım
7 Temmuz 2004
Mesajlar
12,406
Excel Vers. ve Dili
64 Bit 2010 - İngilizce
+
Google Sheets
+
JScript
Altın Üyelik Bitiş Tarihi
Kod:
Private Sub UserForm_Initialize()
    Dim X1 As Long, Y1 As Long, Y2 As Long, X2 As Long
    Dim CX As Double, CY As Double
    Dim MyCtrl As Control
    Application.WindowState = xlMaximized
    X1 = Application.Width
    Y1 = Application.Height
    X2 = Me.Width
    Y2 = Me.Height
    CX = X1 / X2
    CY = Y1 / Y2
    Me.Width = X1
    Me.Height = Y1
    For Each MyCtrl In Me.Controls
        MyCtrl.Top = MyCtrl.Top * CY
        MyCtrl.Left = MyCtrl.Left * CX
        MyCtrl.Width = MyCtrl.Width * CX
        MyCtrl.Height = MyCtrl.Height * CY
            On Error Resume Next
                MyCtrl.Font.Size = MyCtrl.Font.Size * CY
            On Error GoTo 0
    Next
End Sub
 
Son düzenleme:
Üst