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?
Re: Programatically scrolling treeview does not update control
By setting the ResizeRedraw property to true in the constructor, I can use:
VB Code:
me.height+=1
me.height-=1
after I set the scroll bar to force the changes.