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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
| Option Explicit
Public sngZPLZoom As Single
Private Sub Form_Load()
picZPLView.Cls
sngZPLZoom = 6
picZPLView.Width = (txtEtiquette(0).Text * sngZPLZoom) + &H2
picZPLView.Height = (txtEtiquette(0).Text * sngZPLZoom) + &H6
Call Form_Resize
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload frmPrincipal ' DECHARGMENT DE LA FENETRE.
Set frmPrincipal = Nothing ' RESTAURATION DE LA MEMOIRE.
picZPLView.Cls
End Sub
Private Sub Form_Resize()
' DECLARATION DES VARIABLES.
Dim lngX As Long
Dim lngY As Long
Dim lngI As Long
Dim lngJ As Long
Dim sngI As Single
' POSITIONNEMENT DES OBJETS.
If frmPrincipal.WindowState <> 1 Then
lngX = frmPrincipal.Width / Screen.TwipsPerPixelX
lngY = frmPrincipal.Height / Screen.TwipsPerPixelY
picContainer.Width = lngX - 8
picContainer.Height = lngY - 105
picZPLView.Left = (picContainer.Width - picZPLView.Width) / 2
picZPLView.Top = (picContainer.Height - picZPLView.Height) / 2
' AFFICHAGE DE LA REGLE DE GRANDEUR.
picContainer.Cls
picContainer.Line (picZPLView.Left, 0)-(picZPLView.Left, picContainer.Height), &H666666
picContainer.Line ((picZPLView.Left + picZPLView.Width) - 1, 0)-((picZPLView.Left + picZPLView.Width) - 1, picContainer.Height), &H666666
picContainer.Line (&H0, picZPLView.Top)-(picContainer.Width, picZPLView.Top), &H666666
picContainer.Line (&H0, (picZPLView.Top + picZPLView.Height) - 1)-(picContainer.Width, (picZPLView.Top + picZPLView.Height) - 1), &H666666
lngI = 0
For sngI = ((picZPLView.Width) / txtEtiquette(0).Text) To picZPLView.Width - 1 Step ((picZPLView.Width) / txtEtiquette(0).Text)
lngI = lngI + 1
If lngI < 10 Then
If lngI <> 5 Then
picContainer.Line (picZPLView.Left + sngI, picZPLView.Top - 4)-(picZPLView.Left + sngI, picZPLView.Top), &H880000
picContainer.Line (picZPLView.Left + sngI, (picZPLView.Top + picZPLView.Height))-(picZPLView.Left + sngI, (picZPLView.Top + picZPLView.Height) + 4), &H880000
Else
picContainer.Line (picZPLView.Left + sngI, picZPLView.Top - 8)-(picZPLView.Left + sngI, picZPLView.Top), &H880000
picContainer.Line (picZPLView.Left + sngI, (picZPLView.Top + picZPLView.Height))-(picZPLView.Left + sngI, (picZPLView.Top + picZPLView.Height) + 8), &H880000
End If
Else
lngI = 0
lngJ = lngJ + 10
picContainer.Line (picZPLView.Left + sngI, picZPLView.Top - 18)-(picZPLView.Left + sngI, picZPLView.Top), &H880000
picContainer.Line (picZPLView.Left + sngI, (picZPLView.Top + picZPLView.Height))-(picZPLView.Left + sngI, (picZPLView.Top + picZPLView.Height) + 18), &H880000
picContainer.CurrentX = ((picZPLView.Left + sngI) - (picContainer.TextWidth(lngJ) / 2)) - 4
picContainer.CurrentY = picZPLView.Top - 32
picContainer.ForeColor = 0
picContainer.Print lngJ
picContainer.CurrentX = ((picZPLView.Left + sngI) - (picContainer.TextWidth(lngJ) / 2)) - 4
picContainer.CurrentY = picZPLView.Top - 33
picContainer.ForeColor = &HFFFFFF
picContainer.Print lngJ
picContainer.CurrentX = ((picZPLView.Left + sngI) - (picContainer.TextWidth(lngJ) / &H2)) - &H4
picContainer.CurrentY = picZPLView.Top + picZPLView.Height + &H11
picContainer.ForeColor = 0
picContainer.Print lngJ
picContainer.CurrentX = ((picZPLView.Left + sngI) - (picContainer.TextWidth(lngJ) / &H2)) - &H5
picContainer.CurrentY = picZPLView.Top + picZPLView.Height + &H10
picContainer.ForeColor = &HFFFFFF
picContainer.Print lngJ
End If
Next sngI
lngI = 0
lngJ = 0
For sngI = ((picZPLView.Height) / txtEtiquette(1).Text) To picZPLView.Height - &H1 Step ((picZPLView.Height) / txtEtiquette(1).Text)
lngI = lngI + 1
If lngI < 10 Then
If lngI <> 5 Then
picContainer.Line (picZPLView.Left - 4, picZPLView.Top + sngI)-(picZPLView.Left, picZPLView.Top + sngI), &H880000
picContainer.Line ((picZPLView.Left + picZPLView.Width), picZPLView.Top + sngI)-((picZPLView.Left + picZPLView.Width) + &H4, picZPLView.Top + sngI), &H880000
Else
picContainer.Line (picZPLView.Left - &H8, picZPLView.Top + sngI)-(picZPLView.Left, picZPLView.Top + sngI), &H880000
picContainer.Line ((picZPLView.Left + picZPLView.Width), picZPLView.Top + sngI)-((picZPLView.Left + picZPLView.Width) + &H8, picZPLView.Top + sngI), &H880000
End If
Else
lngI = &H0
lngJ = lngJ + 10
picContainer.Line (picZPLView.Left - 18, picZPLView.Top + sngI)-(picZPLView.Left, picZPLView.Top + sngI), &H880000
picContainer.Line ((picZPLView.Left + picZPLView.Width), picZPLView.Top + sngI)-((picZPLView.Left + picZPLView.Width) + 18, picZPLView.Top + sngI), &H880000
picContainer.CurrentX = picZPLView.Left - (picContainer.TextWidth(lngJ) + &H1A)
picContainer.CurrentY = ((picZPLView.Top + sngI) - (picContainer.TextHeight(lngJ) / &H2))
picContainer.ForeColor = &H0
picContainer.Print lngJ
picContainer.CurrentX = picZPLView.Left - (picContainer.TextWidth(lngJ) + &H1B)
picContainer.CurrentY = ((picZPLView.Top + sngI) - (picContainer.TextHeight(lngJ) / &H2)) - &H1
picContainer.ForeColor = &HFFFFFF
picContainer.Print lngJ
picContainer.CurrentX = (picZPLView.Left + picZPLView.Width) + 18
picContainer.CurrentY = ((picZPLView.Top + sngI) - (picContainer.TextHeight(lngJ) / &H2))
picContainer.ForeColor = &H0
picContainer.Print lngJ
picContainer.CurrentX = (picZPLView.Left + picZPLView.Width) + &H11
picContainer.CurrentY = ((picZPLView.Top + sngI) - (picContainer.TextHeight(lngJ) / &H2)) - &H1
picContainer.ForeColor = &HFFFFFF
picContainer.Print lngJ
End If
Next sngI
End If
End Sub
Private Sub cmdAction_Click(Index As Integer)
Select Case Index
Case &H2:
sngZPLZoom = 6.2
picZPLView.Cls
picZPLView.Width = (txtEtiquette(&H0).Text * sngZPLZoom) + &H2
picZPLView.Height = (txtEtiquette(&H1).Text * sngZPLZoom) + &H6
Call Form_Resize
Case &H3:
If sngZPLZoom < 10 Then
sngZPLZoom = sngZPLZoom + 0.2
picZPLView.Cls
picZPLView.Width = (txtEtiquette(&H0).Text * sngZPLZoom) + &H2
picZPLView.Height = (txtEtiquette(&H1).Text * sngZPLZoom) + &H6
Call Form_Resize
End If
Case &H4:
If sngZPLZoom > 2.4 Then
sngZPLZoom = sngZPLZoom - 0.2
picZPLView.Cls
picZPLView.Width = (txtEtiquette(&H0).Text * sngZPLZoom) + &H2
picZPLView.Height = (txtEtiquette(&H1).Text * sngZPLZoom) + &H6
Call Form_Resize
End If
End Select
End Sub |
Partager