TREEVIEW en mode OwnerDrawText
Bonjour,
J'utilise un Treeview et l'évènement DrawNode pour changer l'apparence du texte (brush et Font).
Mon problème est que lorsque j'expand un noeud, j'ai cet espèce de "gribouillage" qui apparait tout en haut... (cf. img jointe).
Avez vous une idée d'où cela peut venir ?
Merci d'avance pour vos réponses.
http://w3m-solutions.fr/test/img/pbTreeView.jpg
Code:
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
|
Private Sub treeArbo_DrawNode(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawTreeNodeEventArgs) Handles treeArbo.DrawNode
If wdo Is Nothing Then
Exit Sub
End If
Try
Dim obj As objNoeudCahier = _cahier.GetObjParNode(e.Node)
If obj IsNot Nothing Then
e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(224, 224, 224)), NodeBounds(e.Node))
e.Graphics.DrawString(e.Node.Text, GetFont(e.Node), GetBrushAndSetMessage(obj), e.Bounds.Left + 2, e.Bounds.Top + 5)
End If
Catch ex As Exception
End Try
End Sub |