Multiline Treeview

Shane N

New member
Joined
Jun 28, 2006
Messages
4
Programming Experience
5-10
I'm working on trying to get multiple lines to work with a treeview. The tree is only going to be two deep with the first depth being a date, and the second being the corresponding customer service entries. The first row doesn't need the multiple line, but obviously, a customer service entry definitely can have multiple rows.

Here is what I am trying right now and it accepts the new lines, but it doesn't expand the size of the row to fit the additional lines:

VB.NET:
Expand Collapse Copy
   Public Sub DrawNodeText(ByVal sender As Object, ByVal e As DrawTreeNodeEventArgs)
      If (Not IsNothing(e.Node.Parent) AndAlso e.Node.Parent.IsExpanded AndAlso e.Bounds.Y > 0) Then
         e.Graphics.DrawString(e.Node.Text, Me.HistoryView.Font, Brushes.Black, New Point(e.Node.Bounds.Left, e.Node.Bounds.Top))
         e.Bounds.Inflate(0, 200)
      Else
         e.DrawDefault = True
      End If
   End Sub

Any suggestions/advice?
 
Treeview only support one common ItemHeight for all items.
 
Back
Top