1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
'CODE QUE J'AI AJOUTE
Private Sub MultiPage1_Change()
Dim I As Byte
For I = 0 To 5
MultiPage1.Pages(I).Visible = IIf(MultiPage1.Value = I, True, False)
Next I
End Sub
Private Function resizeMulti()
With MultiPage1
.width = Mpage(.Value).width
.height = Mpage(.Value).height
bouton1.Left = Mpage(.Value).leftbutton1: bouton1.Top = .height + Mpage(.Value).Weight_Cadre
bouton2.Left = Mpage(.Value).leftbutton2: bouton2.Top = .height + Mpage(.Value).Weight_Cadre
bouton3.Left = Mpage(.Value).leftbutton3: bouton3.Top = .height + Mpage(.Value).Weight_Cadre
Me.height = .height + bouton1.height + Mpage(.Value).hcaption + Mpage(.Value).Weight_Cadre * 2
Me.width = .width + Mpage(.Value).hcaption
End With
End Function
Private Sub UserForm_Activate()
Dim WW&, HH&, lC$, minlarge&, ctrl As Object
For Each pag In MultiPage1.Pages
ReDim Preserve Mpage(0 To pag.Index)
WW = 0: HH = 0
For Each ctrl In pag.Controls
If ctrl.Left + ctrl.width + 20 > WW Then WW = ctrl.Left + ctrl.width + 20:
If ctrl.Top + ctrl.height + 25 > HH Then HH = ctrl.Top + ctrl.height + 25
Next
Mpage(pag.Index).width = WW: Mpage(pag.Index).height = HH
Mpage(pag.Index).leftbutton1 = WW - bouton1.width * 3.5
Mpage(pag.Index).leftbutton2 = WW - bouton2.width * 2.3
Mpage(pag.Index).leftbutton3 = WW - bouton3.width * 1.15 'J'ai ajouté un 3ème bouton
Mpage(pag.Index).hcaption = Me.height - Me.InsideHeight
Mpage(pag.Index).Weight_Cadre = Me.width - Me.InsideWidth
Next
resizeMulti
End Sub |