Link to home
Start Free TrialLog in
Avatar of choelt
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.ToString)
        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.
Avatar of Kinger247
Kinger247

Seems ok to me, I'm on vs2005 though ??
Avatar of choelt

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.ToString)
        Next i
       TreeView1.Scrollable = False
       TreeView1.Scrollable = True
    End Sub

Is your treeview control version 2.0.0.0 ?
ASKER CERTIFIED SOLUTION
Avatar of Sancler
Sancler

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of choelt

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.