[2005] Panel Vertical Scrollbar: scrolling it to zero or top
When a panel's AutoScroll is set True then it will add scrollbars for navigation of the entire size of its content. What I want is to be able to set the vertical scrollbar to go to top or zero so its contents top controls will be viewable.
Anyone who can guide me on how should this be done?
Thank you so much!
Regards,
™
As a gesture of gratitude please consider rating helpful posts. c",)
Re: [2005] Panel Vertical Scrollbar: scrolling it to zero or top
I think this will do it;
Code:
Me.AutoScrollPosition = New Point(0, 0)
To keep a scroll in position I have used;
Code:
Dim ScrollPosition As Point = Me.AutoScrollPosition
'Do stuff
Me.AutoScrollPosition = New Point( _
Math.Abs(ScrollPosition.X), Math.Abs(ScrollPosition.Y))
Re: [2005] Panel Vertical Scrollbar: scrolling it to zero or top
Arrrggg... Its not working 100% as I've expected.
I am actually trying to tame this bug of a ComponentOne control (DockingTab) wherein upon clicking the tabs then it will scroll the panel to body of the tab where its caption will not be visible anymore.
But the sad thing is it will not work the first time I select a different tab but will work on succeeding tabs. And again, it will behave as stated earlier when the application lost focus! What a pain... =(
Could anyone suggest some further workarounds I could try? One I idea that I have in mind is to 'lock' the scrolling of the panel if the scrolling was not executed by a user but that would be difficult I guess. I could try hooking some messages like mousescroll or something but perhaps there could be some other way which is more elegant.
EDIT:
Attach is a screenshot of what I am trying to fix.
Last edited by dee-u; Feb 16th, 2009 at 09:08 AM.
Regards,
™
As a gesture of gratitude please consider rating helpful posts. c",)
Re: [2005] Panel Vertical Scrollbar: scrolling it to zero or top
The code I posted in post #4 behaves the same as your suggestion. I have put it in the SelectedIndexChanged of the DockingTab control. I even tried your code if it will make a difference but it did not since it will just be the same as the one I currently have.
Regards,
™
As a gesture of gratitude please consider rating helpful posts. c",)
Re: [2005] Panel Vertical Scrollbar: scrolling it to zero or top
Since it looks like you have a small gap in H and V, then is it a Margin issue? So if in your panel you set YourControl.Margin = New Padding(0) do the scrollbars grow a little?
Re: [2005] Panel Vertical Scrollbar: scrolling it to zero or top
Those are not small gaps but rather two different versions where on image 1 the tab captions are still showing and on image2 the captions are now hidden since the panel has autoscrolled for some reason I am not aware of.
In an attempt to determine what causes the scrollbar to autoscroll like that I have tried using this panel and yet both ScrollVertical and ScrollMouseWheel was not fired when it autoscrolled!