ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] Userform³Ì¤j¤Æ(¥B¤º®e¤ñ¨Ò¦Û°Ê©ñ¤j?)

§Ú¤]²Ä¤@¦¸¥ÎZOOM
µo²{¥¦¦³¯Ê³´, ¼e°ª¥u¯à¦P©ñ¤j©ÎÁY¤p, ¤£¯à¤@Ãä©ñ¤j¥t¤@ÃäÁY¤p
¥u¦n¾E´N¥¦

// ================

Dim Form_First_wh
Dim Form_Last_wh

   
    Private Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
    Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
    Private Declare Function SetActiveWindow Lib "user32" (ByVal hWnd As Long) As Long
    Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
    Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
    Private Const WS_MAXIMIZEBOX = &H10000
    Private Const WS_MINIMIZEBOX = &H20000
    Private Const GWL_STYLE = (-16)
    Private Const SW_SHOWMAXIMIZED = 3
    Private Const SW_SHOWNORMAL = 1
    Private Const SW_SHOWMINIMIZED = 2
    Private Const WS_THICKFRAME = &H40000
    Const SM_CXFULLSCREEN = 16
    Const SM_CYFULLSCREEN = 17
    Const HWND_TOPMOST = -1
    Const SWP_SHOWWINDOW = &H40
    Dim hWndForm As Long
    Dim IStyle As Long




    Private Sub UserForm_Initialize()
      hWndForm = FindWindow("ThunderDFrame", Me.Caption)
      IStyle = GetWindowLong(hWndForm, GWL_STYLE)
      IStyle = IStyle Or WS_THICKFRAME
      IStyle = IStyle Or WS_MINIMIZEBOX
      IStyle = IStyle Or WS_MAXIMIZEBOX
      
      SetWindowLong hWndForm, GWL_STYLE, IStyle
      
      Form_First_wh = Array(UserForm1.Width, UserForm1.Height)
      Form_Last_wh = Form_First_wh
    End Sub

    Public Sub myShowMax()
        SetActiveWindow hWndForm
        ShowWindow hWndForm, SW_SHOWMAXIMIZED
    End Sub

Private Sub UserForm_Resize()
If (Form_First_wh(1) - UserForm1.Height) * (Form_First_wh(0) - UserForm1.Width) < 0 Then
     MsgBox "UserForm1.Zoom µLªk¤ä´©µøµ¡¤@Ãä©ñ¤j, ¥t¤@Ãä«oÁY¤p"
     UserForm1.Move UserForm1.Left, UserForm1.Top, Form_Last_wh(0), Form_Last_wh(1)
     Exit Sub
End If

On Error Resume Next
If Abs(Form_First_wh(1) - UserForm1.Height) > Abs(Form_First_wh(0) - UserForm1.Width) Then
     UserForm1.Width = UserForm1.Height / Form_First_wh(1) * Form_First_wh(0)
Else
    UserForm1.Height = UserForm1.Width / Form_First_wh(0) * Form_First_wh(1)
End If
On Error GoTo 0

   Form_Last_wh = Array(UserForm1.Width, UserForm1.Height)
UserForm1.Zoom = UserForm1.Height / Form_First_wh(1) * 100
End Sub

TOP

¥»©«³Ì«á¥Ñ bobomi ©ó 2015-5-17 12:04 ½s¿è

§Ú®³¨ì13¦Tµ§¹q¸Õ
¤ñ¨Ò¦n¹³ok­C
¦ý¬Oµ§¹q¦³¶}µøı¯S®Ä
¤~µo²{§Úªº¼gªk·|¦]¬°µøı¯S®Ä¤@ª½¨ê·s¿Ã¹õ
¾É­P UserForm1 ¥X²{Ÿ§Ý ( ®à¾÷¨S¶}µøı¯S®Ä , ¤£·|¦³³o°ÝÃD )

©Ò¥H§A§ï¦¨³o¼Ë¬Ý¬Ý
¤£¥h­×§ïUserForm1 ¼e°ª, ¨Ï¨ä¦Û¥Ñ«×³Ì¤j
¦ý¯ÊÂI§A©Ô©Ô¬Ý´Nª¾¹D¤F
³o°ÝÃD¥X¦b  ZOOM ¼e°ª¥u¯à¦P©ñ¤j©ÎÁY¤p, ¤£¯à¤@Ãä©ñ¤j¥t¤@ÃäÁY¤p
¤£µM code ¥u­n2¦æ´N¸Ñ¨M¤F

(1)
Private Sub UserForm_Resize()
On Error Resume Next
UserForm1.Zoom = UserForm1.Height / Form_First_wh(1) * 100
End Sub
(2)
Private Sub UserForm_Resize()
On Error Resume Next
UserForm1.Zoom = UserForm1.Width / Form_First_wh(0) * 100
End Sub
(1) (2) ¤À§O´ú¸Õ¤@¤U, ¬Ý¬Ý­þ­Ó¤ñ¸û¾A¦X

TOP

¦pªGÁÙ¬O¤£¦æ
§â UserForm1 ªºµ{¦¡½X§R¥ú(¥u¯d±±¨î¶µ´N¥i¥H¤F )
µM«á¶×¥X UserForm1  -> ¤W¶Ç UserForm1.frm
§Ú¦A©Ô©Ô¬Ý¬°¦ó¤£¦æ

TOP

¥»©«³Ì«á¥Ñ bobomi ©ó 2015-5-17 14:30 ½s¿è

§ï¦¨¤U­±ªº code  (¦³µo²{°ÝÃD¦b­þ¤F)
¬Ý¬Ýµ§¹qªº13"¿Ã¹õ°ÝÃD¬O§_§ïµ½
========================
Dim Form_First_wh
Dim Form_Last_wh
Dim UserForm1_BarHeight

   
    Private Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
    Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
    Private Declare Function SetActiveWindow Lib "user32" (ByVal hWnd As Long) As Long
    Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
    Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
    Private Const WS_MAXIMIZEBOX = &H10000
    Private Const WS_MINIMIZEBOX = &H20000
    Private Const GWL_STYLE = (-16)
    Private Const SW_SHOWMAXIMIZED = 3
    Private Const SW_SHOWNORMAL = 1
    Private Const SW_SHOWMINIMIZED = 2
    Private Const WS_THICKFRAME = &H40000
    Const SM_CXFULLSCREEN = 16
    Const SM_CYFULLSCREEN = 17
    Const HWND_TOPMOST = -1
    Const SWP_SHOWWINDOW = &H40
    Dim hWndForm As Long
    Dim IStyle As Long


    Private Sub UserForm_Initialize()
      hWndForm = FindWindow("ThunderDFrame", Me.Caption)
      IStyle = GetWindowLong(hWndForm, GWL_STYLE)
      IStyle = IStyle Or WS_THICKFRAME
      IStyle = IStyle Or WS_MINIMIZEBOX
      IStyle = IStyle Or WS_MAXIMIZEBOX
      
      SetWindowLong hWndForm, GWL_STYLE, IStyle
      
      
      a = UserForm1.Height
      UserForm1.Height = 0
      UserForm1_BarHeight = UserForm1.Height
      UserForm1.Height = a + 1.5
      
      Form_First_wh = Array(UserForm1.Width, UserForm1.Height)
      Form_Last_wh = Form_First_wh
    End Sub

    Public Sub myShowMax()
        SetActiveWindow hWndForm
        ShowWindow hWndForm, SW_SHOWMAXIMIZED
    End Sub

Private Sub UserForm_Resize()
If Not IsArray(Form_First_wh) Then Exit Sub
' If (Form_First_wh(1) - UserForm1.Height) * (Form_First_wh(0) - UserForm1.Width) < 0 Then
'     MsgBox "UserForm1.Zoom µLªk¤ä´©µøµ¡¤@Ãä©ñ¤j, ¥t¤@Ãä«oÁY¤p"
'     UserForm1.Move UserForm1.Left, UserForm1.Top, Form_Last_wh(0), Form_Last_wh(1)
'     Exit Sub
' End If

On Error Resume Next
If Abs(Form_First_wh(1) - UserForm1.Height) > Abs(Form_First_wh(0) - UserForm1.Width) Then
     UserForm1.Width = (UserForm1.Height - UserForm1_BarHeight) / (Form_First_wh(1) - UserForm1_BarHeight) * Form_First_wh(0)
Else
    UserForm1.Height = UserForm1.Width / Form_First_wh(0) * (Form_First_wh(1) - UserForm1_BarHeight) + UserForm1_BarHeight
   'UserForm1.Height = UserForm1.Width / Form_First_wh(0) * Form_First_wh(1)
End If
On Error GoTo 0

   Form_Last_wh = Array(UserForm1.Width, UserForm1.Height)
On Error Resume Next
UserForm1.Zoom = (UserForm1.Height - UserForm1_BarHeight) / (Form_First_wh(1) - UserForm1_BarHeight) * 100
End Sub

TOP

ÁÙ¦³¤@­Ó¤èªk, ´N¬O¤£­n¥Î ZOOM , §ï¦¨¦Û¤vÁY©ñ

TOP

Zoom  ¤ñ¸û¦nªº¤è®×
22.zip (12.39 KB)

TOP

UserForm.Zoom3.zip (15.19 KB)

TOP

1.zip (2.71 KB)
³Ì¤j¤Æ®É, ±±¥ó¤£·|¹L¤j

TOP

¦^´_ 23# PKKO

zoom ´N¥u¯à³o¼Ë (¥¦ªº¼e°ª³£¥u¯à¬O¬Û¦P¤ñ¨Ò)
­n·Q ¤UÃ䪺±±¥ó¤£·|¹LÀY, ¨º»ò¥kÃä´N·|¦³¦h¾lªºªÅ¶¡  
­n·Q¥kÃä¨S¦³¦h¾lªºªÅ¶¡ , ¨º»ò¤UÃ䪺±±¥ó´N·|¹LÀY

¦Û¤vÁY©ñ¨S¦³¤W­±°ÝÃD ( ¦ý¬O¦r«¬µLªk§¹¬üÁY©ñ  )
²×·¥¤@ÂI  ¦Û¤vÁY©ñ + Zoom ²V·f -> ¦r«¬¥i¥H¸û§¹¬üÁY©ñ

TOP

1.zip (2.71 KB)
³o¼ËÁÙ·|»\¨ì¶Ü?

TOP

        ÀR«ä¦Û¦b : ¥Í®ð¡A´N¬O®³§O¤Hªº¹L¿ù¨ÓÃg»@¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD