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 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
Option Compare Database
Option Explicit
Private Sub OptImEtat_AfterUpdate()
Dim HautDet As Integer
Dim LargDet As Integer
DoCmd.OpenReport "E_Resultat", acViewDesign, , , acHidden
HautDet = Reports!E_Resultat.Détail.Height
LargDet = Reports!E_Resultat.Width
Select Case OptImEtat
Case 1
Reports!E_Resultat.Image0.Visible = True
Call positcont(Reports!E_Resultat.Image0, 0, 0, LargDet, HautDet)
Reports!E_Resultat.Image1.Visible = False
Reports!E_Resultat.Image2.Visible = False
Reports!E_Resultat.Image3.Visible = False
Case 2
Reports!E_Resultat.Image0.Visible = True
Call positcont(Reports!E_Resultat.Image0, 0, 0, Int(LargDet / 2), HautDet)
Reports!E_Resultat.Image1.Visible = True
Call positcont(Reports!E_Resultat.Image1, 0, Int(LargDet / 2) + 1, Int(LargDet / 2), HautDet)
Reports!E_Resultat.Image2.Visible = False
Reports!E_Resultat.Image3.Visible = False
Case 3
Reports!E_Resultat.Image0.Visible = True
Call positcont(Reports!E_Resultat.Image0, 0, 0, Int(LargDet / 3), HautDet)
Reports!E_Resultat.Image1.Visible = True
Call positcont(Reports!E_Resultat.Image1, 0, Int(LargDet / 3) + 1, Int(LargDet / 3), HautDet)
Reports!E_Resultat.Image2.Visible = True
Call positcont(Reports!E_Resultat.Image2, 0, Int(2 * LargDet / 3) + 1, Int(LargDet / 3), HautDet)
Reports!E_Resultat.Image3.Visible = False
Case 4
Reports!E_Resultat.Image0.Visible = True
Call positcont(Reports!E_Resultat.Image0, 0, 0, Int(LargDet / 2), Int(HautDet / 2))
Reports!E_Resultat.Image1.Visible = True
Call positcont(Reports!E_Resultat.Image1, 0, Int(LargDet / 2) + 1, Int(LargDet / 2), Int(HautDet / 2))
Reports!E_Resultat.Image2.Visible = True
Call positcont(Reports!E_Resultat.Image2, Int(HautDet / 2) + 1, 0, Int(LargDet / 2), Int(HautDet / 2))
Reports!E_Resultat.Image3.Visible = True
Call positcont(Reports!E_Resultat.Image3, Int(HautDet / 2) + 1, Int(2 * LargDet / 3) + 1, Int(LargDet / 3), Int(HautDet / 2))
End Select
DoCmd.Close acReport, "E_Resultat", acSaveYes
DoCmd.OpenReport "E_Resultat", acViewPreview
End Sub
Private Sub positcont(acont As Control, _
nivhaut As Integer, _
nivgauche As Integer, _
parlargeur As Integer, _
parhauteur As Integer)
acont.Top = nivhaut
acont.Left = nivgauche
acont.Width = parlargeur
acont.Height = parhauteur
End Sub |
Partager