Connecting Tech Pros Worldwide Forums | Help | Site Map

Scrolling with Scrollbar hidden?

Newbie
 
Join Date: Jun 2009
Posts: 5
#1: Jun 25 '09
Hello,

Is there a way to scroll inside a Panel but with the scroll bar hidden? hmm.. let me explain.

I have a Panel that contains buttons. These buttons are created programatically depending on the information gathered from a Database. Some buttons may be outside the range of view if there are a lot of records.

I want the user to be able to scroll down when he clicks a Button which is created outside the Panel and has nothing to do with the buttons created with the information from the Database. The only relation is the fact that it only appears when there are buttons created outside the range of view... anyway, the buttons are created fine.

However I am not able to scroll down unless I put panel1.AutoScroll = true; ... even if I put panel1.VerticalScroll.Visible = false; the scrollbar can be seen.

I already tried putting a Parent Panel with AutoScroll and the Child Panel without it and move the AutoScrollPosition of the Parent but it doesn't work.

Maybe there's another way to simulate this?? I tried using an array of Panels but I couldn't figure out at the momento of clicking the Button how to know which of the Panels was the active (seen by the user) one.

Thanks in advance!!

Newbie
 
Join Date: Jun 2009
Posts: 1
#2: Jun 25 '09

re: Scrolling with Scrollbar hidden?


I think that "panel1.VerticalScroll.Value" can help you.

Good luck.
Newbie
 
Join Date: Jun 2009
Posts: 5
#3: Jun 25 '09

re: Scrolling with Scrollbar hidden?


Thank you very much!!! It works
Newbie
 
Join Date: Jun 2009
Posts: 5
#4: Jun 26 '09

re: Scrolling with Scrollbar hidden?


UPDATE:

I was able to scroll down but I was having problems scrolling back up. For some weird reason the IF statement I had wasn't working.. I tried with several expressions like:

if(panel.VerticalScroll.Value != 0)
if(panel.VerticalScroll.Value == panel.VerticalScroll.Maximum)

and some others... but it would always go to the ELSE clause which is the one that scrolls down. The only way the IF would work is if I put panel.AutoScroll = true.

So here's what I did... I put panel.AutoScroll = true which we know, makes the Scrollbar visible (which I don't want) but then I made another panel (thin and the same height as the main one) that would hide the scrollbar... and there I have it, it works as I want.

I hope this helps anyone else and doesn't spend as much time with this as I did =)
Reply