-
Apr 22nd, 2006, 06:44 PM
#1
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.
-
Apr 23rd, 2006, 05:14 PM
#2
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|