|
-
Apr 27th, 2016, 10:12 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] Trying to set scrollbar position but it won't budge
I have a dynamically-created panel with a horizontal scrollbar which is created by placing controls outside of the panel. I want to set the scrollbar but it won't budge.
Code:
Me.Controls.Add(ReportPanel)
ReportPanel.AutoScrollPosition = New Point(100, 0)
ReportPanel.Visible = True
Any ideas?
I've tried rearranging these statements. I've been banging my head into a wall about this. For what it's worth the following
Code:
ReportPanel.HorizontalScroll.Value = 100
does cause the scrollbar to move but the controls shift with it.
-
Apr 27th, 2016, 10:56 AM
#2
Re: Trying to set scrollbar position but it won't budge
Well, the purpose of the scroll bar is to move the controls, so if you change the thumb position, then the controls should move, so I'm not sure what you are trying to accomplish.
If you want a scrollbar that you can move the thumb without moving the controls, then add a scrollbar to your panel.
-
Apr 27th, 2016, 11:03 AM
#3
Thread Starter
Fanatic Member
Re: Trying to set scrollbar position but it won't budge
 Originally Posted by passel
Well, the purpose of the scroll bar is to move the controls, so if you change the thumb position, then the controls should move, so I'm not sure what you are trying to accomplish.
If you want a scrollbar that you can move the thumb without moving the controls, then add a scrollbar to your panel.
I'm trying to scroll the panel with code. The panel has a scrollbar on it.
-
Apr 27th, 2016, 11:04 AM
#4
Frenzied Member
Re: Trying to set scrollbar position but it won't budge
You can try using the 'ScrollControlIntoView' function..
ReportPanel.ScrollControlIntoView(yourcontrol)
-
Apr 27th, 2016, 11:33 AM
#5
Thread Starter
Fanatic Member
Re: Trying to set scrollbar position but it won't budge
I thought I had tried putting the ReportPanel.Visible = True statement before the other 2 statements. Apparently not. So I tried that and now it's working fine! Sorry for the trouble.
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
|