Results 1 to 2 of 2

Thread: Programatically scrolling treeview does not update control *resolved*

  1. #1

    Thread Starter
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Programatically scrolling treeview does not update control *resolved*

    I created a custom treeview to trap the scroll event. I use that information to syncronize the scrolling of another treeview. When I use the SetScrollInfo api call, the scroll bar moves, but the data inside the control stays the same. I noticed when I minimized, then maximized my form the control would redraw itself correctly so I tried these treeview methods with no luck:
    Invalidate()
    Refresh()
    InitLayout()
    RaisePaintEvent(Me, New Windows.Forms.PaintEventArgs(Me.CreateGraphics(), Me.ClientRectangle))
    SendToBack()
    BringToFront()

    I developed a work around by finding the first and last visable node of my original treeview, then using the ensurevisable method, I'm able to get everything to line up. The problem is the overhead of finding the nodes in both treeviews. Does anybody have an idea for a method I could call to force the treeview to repaint itself?
    Last edited by wild_bill; Apr 23rd, 2006 at 05:14 PM.

  2. #2

    Thread Starter
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Re: Programatically scrolling treeview does not update control

    By setting the ResizeRedraw property to true in the constructor, I can use:
    VB Code:
    1. me.height+=1
    2. me.height-=1
    after I set the scroll bar to force the changes.

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