- 帖子
- 5923
- 主題
- 13
- 精華
- 1
- 積分
- 5986
- 點名
- 0
- 作業系統
- win10
- 軟體版本
- Office 2010
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台灣基隆
- 註冊時間
- 2010-5-1
- 最後登錄
- 2022-1-23
        
|
3#
發表於 2013-7-17 16:56
| 只看該作者
回復 2# stillfish00
加上可還原(原來的大小)- Option Explicit
- Dim xME()
- Private Sub UserForm_Initialize()
- Dim i As Integer, e As Variant
- ReDim xME(0 To Controls.Count)
- xME(0) = Array(Top, Left, Height, Width, Font.Size)
- For Each e In Controls
- With e
- i = i + 1
- xME(i) = Array(.Top, .Left, .Height, .Width, .Font.Size)
- End With
- Next
- End Sub
- Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
- Dim i As Integer, e As Variant
- Static lastY As Single
- Debug.Print Shift
- 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
- ElseIf Button = 2 And Shift = 2 Then '按下右鍵
- Top = xME(0)(0)
- Left = xME(0)(1)
- Height = xME(0)(2)
- Width = xME(0)(3)
- Font.Size = xME(0)(4)
- For Each e In Controls
- With e
- i = i + 1
- .Top = xME(i)(0)
- .Left = xME(i)(1)
- .Height = xME(i)(2)
- .Width = xME(i)(3)
- .Font.Size = xME(i)(4)
- End With
- Next
- End If
- End Sub
複製代碼 |
|