Option Explicit
Dim oldx, oldy
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub UserForm_Activate()
Dim ex#, ey#
With Me
oldx = .Width
oldy = .Height
For Each ctrl In Me.Controls
ctrl.Tag = Join(Array(ctrl.Left, ctrl.Top, ctrl.Width, ctrl.Height), ";")
On Error Resume Next
ctrl.Tag = ctrl.Tag & ";" & ctrl.Font.Size
Err.Clear
Next
ex = .Width - .InsideWidth
ey = .Height - .InsideHeight
.Top = -ey
.Left = -ex
.Width = Application.Width - ex
End With
End Sub
Private Sub UserForm_Resize()
Dim Dimo, i&, ctrl, newlarge, newh
On Error Resume Next
i = 0
For Each ctrl In Controls
Dimo = Split(ctrl.Tag, ";")
newlarge = Me.Width / oldx: newh = Me.Height / oldy
ctrl.Move Dimo(0) * newlarge, Dimo(1) * newh, Dimo(2) * newlarge
'ctrl.FontSize =
Next
End Sub
Option Explicit
Dim oldx, oldy
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub UserForm_Activate()
Dim ex#, ey#
With Me
oldx = .Width
oldy = .Height
For Each ctrl In Me.Controls
ctrl.Tag = Join(Array(ctrl.Left, ctrl.Top, ctrl.Width, ctrl.Height), ";")
On Error Resume Next
ctrl.Tag = ctrl.Tag & ";" & ctrl.Font.Size
Err.Clear
Next
ex = .Width - .InsideWidth
ey = .Height - .InsideHeight
.Top = -ey
.Left = -ex
.Width = Application.Width - ex
End With
End Sub
Private Sub UserForm_Resize()
Dim Dimo, i&, ctrl, newlarge, newh
On Error Resume Next
i = 0
For Each ctrl In Controls
Dimo = Split(ctrl.Tag, ";")
newlarge = Me.Width / oldx: newh = Me.Height / oldy
ctrl.Move Dimo(0) * newlarge, Dimo(1) * newh, Dimo(2) * newlarge
'ctrl.FontSize =
Next
End Sub
oui pourquoi pason peut trouver une astuce autre plus cachée si tu veux
celui d'Excel?et il y a moyen de cacher le ruban aussi si tu veux
Option Explicit
Dim oldx, oldy
Dim codekey
Dim counter
Private Sub CommandButton1_Click()
'Unload Me
End Sub
Private Sub CommandButton1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
counter = counter + 1
codekey = codekey + KeyCode
If codekey = 30 Then Unload Me Else If counter = 2 Then counter = 0: codekey = 0
End Sub
Private Sub UserForm_Activate()
Dim ex#, ey#, ptopx
With Me
oldx = .Width
oldy = .Height
For Each ctrl In Me.Controls
ctrl.Tag = Join(Array(ctrl.Left, ctrl.Top, ctrl.Width, ctrl.Height), ";")
On Error Resume Next
ctrl.Tag = ctrl.Tag & ";" & ctrl.Font.Size
Err.Clear
Next
ex = .Width - .InsideWidth
ey = .Height - .InsideHeight
.Top = -ey
.Left = -ex
.Width = Application.Width - ex
ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",false)" 'voila comment on vire le ruban
End With
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",true)" 'voila comment on remet le ruban
End Sub
Private Sub UserForm_Resize()
Dim Dimo, i&, ctrl, newlarge, newh
i = 0
For Each ctrl In Controls
Dimo = Split(ctrl.Tag, ";")
newlarge = Me.Width / oldx: newh = Me.Height / oldy
ctrl.Move Dimo(0) * newlarge, Dimo(1) * newh, Dimo(2) * newlarge, Dimo(3) * newh
Next
End Sub
Option Explicit
Dim oldx, oldy
Dim codekey
Dim counter
Private Sub CommandButton1_Click()
If codekey = 17 Then Unload Me
End Sub
Private Sub CommandButton1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
'counter = counter + 1
'codekey = codekey + KeyCode
'If codekey = 30 Then Unload Me Else If counter = 2 Then counter = 0: codekey = 0
codekey = KeyCode
End Sub
Private Sub CommandButton1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
codekey = 0
End Sub
Private Sub UserForm_Activate()
Dim ex#, ey#, ptopx
With Me
oldx = .Width
oldy = .Height
For Each ctrl In Me.Controls
ctrl.Tag = Join(Array(ctrl.Left, ctrl.Top, ctrl.Width, ctrl.Height), ";")
On Error Resume Next
ctrl.Tag = ctrl.Tag & ";" & ctrl.Font.Size
Err.Clear
Next
ex = .Width - .InsideWidth
ey = .Height - .InsideHeight
.Top = -ey
.Left = -ex
.Width = Application.Width - ex
ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",false)" 'voila comment on vire le ruban
End With
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",true)" 'voila comment on remet le ruban
End Sub
Private Sub UserForm_Resize()
Dim Dimo, i&, ctrl, newlarge, newh
i = 0
For Each ctrl In Controls
Dimo = Split(ctrl.Tag, ";")
newlarge = Me.Width / oldx: newh = Me.Height / oldy
ctrl.Move Dimo(0) * newlarge, Dimo(1) * newh, Dimo(2) * newlarge, Dimo(3) * newh
Next
End Sub