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
|
Protected Overrides Sub OnPaint(e As PaintEventArgs)
MyBase.OnPaint(e)
'---------------------
'Créer le panel
'---------------------
If Not _RDV.SecondPosition Then
Me.Location = New Point(dicEmployéPosition(_RDV.NomCourt_Employé), (dicHeuresVSMultiples(_RDV.HrDébut) - _ScrollValue) * 13)
Else
Me.Location = New Point(dicEmployéPosition(_RDV.NomCourt_Employé) + iJOURNALIER_LargeurColEmployé / 2,
(dicHeuresVSMultiples(_RDV.HrDébut) - _ScrollValue) * 13)
End If
Me.Height = (dicHeuresVSMultiples(_RDV.HrFin) - dicHeuresVSMultiples(_RDV.HrDébut)) * 13
If Not _RDV.DemiLargeur Then
Me.Width = iJOURNALIER_LargeurColEmployé - 2
Else
Me.Width = iJOURNALIER_LargeurColEmployé / 2 - 2
End If
Me.BackColor = Color.Blue
'-----------------------------
'Ajouter les Textes en fonction de la hauteur du RDV
'-----------------------------
Dim lblSoins As Label = New Label
Dim lblHeures As Label = New Label
Dim lblClient As Label = New Label
Dim lblCabine As Label = New Label
Dim txtRemarque As TextBox = New TextBox
Dim myBrush As SolidBrush = New SolidBrush(Color.White)
If Me.Height < (5 + 10 + 5) Then
'On n'affiche rien
Else
'Soin
e.Graphics.DrawString(_RDV.Soin, New Font("Arial", 12, FontStyle.Bold), myBrush, New Point(5, 5))
If Me.Height < (5 + 10 + 5 + 20 + 5) Then
'On n'affiche pas les heures
Else
'Heures
e.Graphics.DrawString(_RDV.Heures, New Font("Arial", 9, FontStyle.Regular), myBrush, New Point(5, 25))
If Me.Height < (5 + 10 + 5 + 20 + 5 + 20 + 5) Then
'On n'affiche pas le client
Else
'Client
e.Graphics.DrawString(_RDV.Client, New Font("Arial", 9, FontStyle.Regular), myBrush, New Point(5, 40))
If Me.Height < (5 + 10 + 5 + 20 + 5 + 20 + 5 + 20 + 5) Then
'on n'affiche pas la cabine
Else
'Cabine
e.Graphics.DrawString(_RDV.Cabine, New Font("Arial", 9, FontStyle.Regular), myBrush, New Point(5, 55))
If Me.Height < (150) Then
'On n'affiche pas la remarque
Else
'Remarque
txtRemarque.Multiline = True
txtRemarque.Location = New Point(5, 75)
txtRemarque.Height = 70
txtRemarque.Width = Me.Width - 10
txtRemarque.BackColor = Color.White
txtRemarque.Text = _RDV.Remarque
Me.Controls.Add(txtRemarque)
End If
End If
End If
End If
End If
'-----------------------------
'Ajouter la ligne de couleur
'-----------------------------
Dim pen As Pen = New Pen(Color.FromArgb(255, 255, 255), 5)
pen.Color = _RDV.LightColor
e.Graphics.DrawLine(pen, New Point(0, 0), New Point(0, Me.Height))
End Sub |
Partager