Results 1 to 8 of 8

Thread: Stupid scrollbar when using a treeview

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2001
    Location
    Guess....i have wooden shoes, in my free time i sell tulips and I live in a huge windmill...
    Posts
    176

    Stupid scrollbar when using a treeview

    Whenever i place a treetriew in a project, a horizontal scrollbar apears. It's not needed, it looks ugly and i can't get ridd of it... Anyone has a sollution?
    Last edited by JpEgy; Apr 23rd, 2002 at 04:30 PM.
    JpEgy

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Dec 2001
    Location
    Guess....i have wooden shoes, in my free time i sell tulips and I live in a huge windmill...
    Posts
    176
    Anyone?
    JpEgy

  3. #3
    Thelonius
    Guest
    How about setting the Scrollable property to false?

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Dec 2001
    Location
    Guess....i have wooden shoes, in my free time i sell tulips and I live in a huge windmill...
    Posts
    176
    i do need the vertical one :-)

    The horizontal one is useless. It's there but u can't click it (slider doesn;t move) and i want to get ridd of it since it looks like ****.
    JpEgy

  5. #5
    Thelonius
    Guest
    This more of workaround and I'm sure there is someway to totally eliminate the scrollbar.

    Try in your Form_Load event

    TreeView1.ExpandAll()
    TreeView1.CollapseAll()

    It eliminates the horizontal scroll unless the tree expands beyond the borders of the control. This way you can still have the vertical scroll and only have the HScroll when necessary.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Dec 2001
    Location
    Guess....i have wooden shoes, in my free time i sell tulips and I live in a huge windmill...
    Posts
    176
    doesn't work..

    check the screenshot...
    Attached Images Attached Images  
    JpEgy

  7. #7
    Thelonius
    Guest
    Let me do some more digging.

  8. #8
    Thelonius
    Guest
    It appears if you load your nodes at runtime, the scrollbar does not show


    Dim i As Integer

    For i = 0 To 20
    Dim nd As New TreeNode()
    nd.Text = "node" & i.ToString
    If i Mod 4 = 0 Then
    Dim nd2 As New TreeNode()
    nd2.Text = "child" & i
    nd2.Checked = True
    nd.Nodes.Add(nd2)

    End If

    TreeView1.Nodes.Add(nd)
    Next

    Let me know if this doesn't work. This is the only way I can consistantly NOT have the HScroll.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width