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
|
Private Sub listeJours_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles listeJours.SelectedIndexChanged
'Création du stylo et du graphique
Dim g As Graphics = Panel1.CreateGraphics
g.Clear(Panel1.BackColor)
Dim mypen As New Pen(Color.Black, 2)
'Requêtes SQL et récupération des données (non affiché)
'*******************************'
g.FillRectangle(New SolidBrush(Color.FromArgb(255, 255, 204, 0)), 10, 30, 90, 25) 'rectangle orange phase
g.DrawString("Phase", New Font("Arial", 12, FontStyle.Bold), Brushes.Black, 10, 35)
g.DrawString(jourGamme, New Font("Arial", 15, FontStyle.Bold), Brushes.Black, 10, 2)
g.DrawString("Jour Give : " & jourGive, New Font("Arial", 12, FontStyle.Bold), Brushes.Black, 1100, 2)
g.FillRectangle(New SolidBrush(Color.FromArgb(255, 153, 204, 255)), 10, 55, 90, 25) 'rectangle bleu équipe
g.DrawString("Equipe", New Font("Arial", 12, FontStyle.Bold), Brushes.Black, 10, 60)
g.FillRectangle(New SolidBrush(Color.FromArgb(255, 204, 153, 255)), 100, 30, 1190, 50) 'rectangle violet phase et heures
'Ecriture des heures
Dim abs As Integer = 0
Dim heure As Integer = 5
For abs = 100 To 1200 Step 100
g.DrawString(heure & "h", New Font("Arial", 10, FontStyle.Regular), Brushes.Black, abs, 65)
heure = heure + 1
Next
'création des points qui définissent le contour du tableau
'--> Simple "dessin"
Dim point1 As New Point(10, 30)
Dim point2 As New Point(10, 530)
Dim point3 As New Point(1290, 30)
Dim point4 As New Point(1290, 530)
Dim ContourTab As Point() = {point1, point2, point4, point3, point1}
g.DrawLines(mypen, ContourTab)
g.DrawLine(mypen, 10, 55, 1290, 55) 'Ligne en dessous de phase
g.DrawLine(mypen, 10, 80, 1290, 80) 'Ligne en dessous d'équipe
g.DrawLine(mypen, 100, 30, 100, 1500) 'Ligne verticale séparateur phase/équipe
'dessin de la grille
Dim abscisse As Integer = 100
Dim ordonnée As Integer = 100
For abscisse = 100 To 1200 Step 100
g.DrawLine(New Pen(Color.Gray, 1), abscisse, 55, abscisse, 530)
Next
For ordonnée = 130 To 500 Step 50
g.DrawLine(New Pen(Color.Gray, 1), 10, ordonnée, 1290, ordonnée)
Next
'-----Partie où intégrer les richtextbox------------
'Libellé de l'unité de travail à gauche dans la colonne équipe
g.DrawString(ligne.LIB_UT, New Font("Arial", 11, FontStyle.Bold), Brushes.Black, 50, 100 + 50 * (numLigne + nbCreneau - Reste))
'Tracer le rectangle
g.FillRectangle(Brushes.Beige, 100 + coordonnée, 80 + 50 * (numLigne + nbCreneau - Reste), 100 * ligne.DUREE_DET_TRAV, 50)
g.DrawString(ligne.LIB_DET_TRAV, New Font("Arial", 9, FontStyle.Bold), Brushes.Black, 100 + coordonnée, 80 + 50 * (numLigne + nbCreneau - Reste)) |