- 帖子
- 5923
- 主題
- 13
- 精華
- 1
- 積分
- 5986
- 點名
- 0
- 作業系統
- win10
- 軟體版本
- Office 2010
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台灣基隆
- 註冊時間
- 2010-5-1
- 最後登錄
- 2022-1-23
        
|
回復 10# GBKEE
表單最大化- Option Explicit
- Private Sub UserForm_Initialize() '表單初始化的程式
- Dim e As Control
- For Each e In Me.Controls
- e.Tag = e.Top & "," & e.Left & "," & e.Width & "," & e.Height & "," & e.Font.Size
- Next
- Form_xlMax
- End Sub
- Private Sub Form_xlMax() '表單最大化
- Dim xlMax As Double, ylMax As Double, xZoom As Double
- Dim e As Control
- With Application
- .WindowState = xlMaximized
- xlMax = .Width
- ylMax = .Height
- End With
- xZoom = 1
- Do While Width < xlMax
- Width = Width * xZoom
- Height = Height * xZoom
- For Each e In Controls
- With e
- .Top = .Top * xZoom
- .Left = .Left * xZoom
- .Width = .Width * xZoom
- .Height = .Height * xZoom
- .Font.Size = .Font.Size * xZoom
- Debug.Print xZoom, .Font.Size
- End With
- Next
- xZoom = xZoom * 1.0000654
- Loop
- Top = 0
- Left = 0
- End Sub
複製代碼 |
|