choelt
asked on
TreeView control partially hiding last node in VB.Net Visual Studio 2005
I can't figure out why the treeview control in a VB.Net app is behaving like this. I can create the behavior as follows: 1) Create a new project -> windows app
2) Add a treeview to the form and place the following code in the form load event handler to fill the treeview with 100 nodes:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
For i As Integer = 1 To 100
TreeView1.Nodes.Add(i.ToSt ring)
Next i
End Sub
When I run the program from with VS it hides part of the last node when I scroll down to the bottom of the treeview. Am I missing something or is this a bug with the control in .NET? I can get it to hide almost all of the last node by changing the height of the control. I keep thinking that I'm just overlooking something simple, but can't figure it out. Please help me to salvage my sanity.
2) Add a treeview to the form and place the following code in the form load event handler to fill the treeview with 100 nodes:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
For i As Integer = 1 To 100
TreeView1.Nodes.Add(i.ToSt
Next i
End Sub
When I run the program from with VS it hides part of the last node when I scroll down to the bottom of the treeview. Am I missing something or is this a bug with the control in .NET? I can get it to hide almost all of the last node by changing the height of the control. I keep thinking that I'm just overlooking something simple, but can't figure it out. Please help me to salvage my sanity.
Seems ok to me, I'm on vs2005 though ??
ASKER
I'm using vs2005 as well. I was able to get it to behave correctly by adding 2 lines as follows:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
For i As Integer = 1 To 100
TreeView1.Nodes.Add(i.ToSt ring)
Next i
TreeView1.Scrollable = False
TreeView1.Scrollable = True
End Sub
Is your treeview control version 2.0.0.0 ?
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
For i As Integer = 1 To 100
TreeView1.Nodes.Add(i.ToSt
Next i
TreeView1.Scrollable = False
TreeView1.Scrollable = True
End Sub
Is your treeview control version 2.0.0.0 ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I agree that it is more than likely a bug and thanks for your in depth analysis. I'm one of those that have to understand why.