- 帖子
- 1018
- 主題
- 15
- 精華
- 0
- 積分
- 1058
- 點名
- 0
- 作業系統
- win7 32bit
- 軟體版本
- Office 2016 64-bit
- 閱讀權限
- 50
- 性別
- 男
- 來自
- 桃園
- 註冊時間
- 2012-5-9
- 最後登錄
- 2022-9-28
|
回復 1# Jared
提供一個方法,根據表單的複雜度,效果可能不一定很好,供你參考:
在該表單的程式碼加上下面Code,開啟表單後,在表單上按:
Ctrl+滑鼠左鍵拖曳向上,可放大表單
Ctrl+滑鼠左鍵拖曳向下,可縮小表單- Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
- Static lastY As Single
-
- If Button = 1 And Shift = 2 Then
- If Y - lastY > 5 Then
- ResizeUserform 1.1
- lastY = Y
- ElseIf lastY - Y > 5 Then
- ResizeUserform 0.9
- lastY = Y
- End If
- End If
- End Sub
- Private Sub ResizeUserform(dSizeCoeff As Double)
- Dim c
- With Me
- .Width = .Width * dSizeCoeff
- .Height = .Height * dSizeCoeff
-
- For Each c In .Controls
- With c
- .Top = .Top * dSizeCoeff
- .Left = .Left * dSizeCoeff
- .Width = .Width * dSizeCoeff
- .Height = .Height * dSizeCoeff
-
- On Error Resume Next
- .Font.Size = .Font.Size * dSizeCoeff
- On Error GoTo 0
- End With
- Next
- End With
- End Sub
複製代碼 |
|