PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms Programatically scrolling a container

Reply

Programatically scrolling a container

 
Thread Tools Rate Thread
Old 09-02-2006, 02:11 PM   #1
JezB
Guest
 
Posts: n/a
Default Programatically scrolling a container


I want a container in which I can control the scrolling programatically. So
it will act like a "window" on top of a larger canvas, with my code
controlling where the window is on the canvas. I don't think Panel will do
the job since you can't set DisplayRectangle programatically.

Any advice ?


  Reply With Quote
Old 09-02-2006, 02:42 PM   #2
Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
Default Re: Programatically scrolling a container

"JezB" <jezbroadsword@blueyonder.co.uk> schrieb:
>I want a container in which I can control the scrolling programatically. So
>it will act like a "window" on top of a larger canvas, with my code
>controlling where the window is on the canvas. I don't think Panel will do
>the job since you can't set DisplayRectangle programatically.


Scrollable container controls have an 'AutoScrollPosition' property which
can be used to control the viewport area.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

  Reply With Quote
Old 09-02-2006, 09:51 PM   #3
JezB
Guest
 
Posts: n/a
Default Re: Programatically scrolling a container

Thanks. Now I just have to work out how this AutoScrollPosition works. Tried
the MSDN documentation and can't work it out ! You set +ve values and it
returns -ve? sheesh.

"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:OyYnLcYLGHA.648@TK2MSFTNGP14.phx.gbl...
> "JezB" <jezbroadsword@blueyonder.co.uk> schrieb:
>>I want a container in which I can control the scrolling programatically.
>>So it will act like a "window" on top of a larger canvas, with my code
>>controlling where the window is on the canvas. I don't think Panel will do
>>the job since you can't set DisplayRectangle programatically.

>
> Scrollable container controls have an 'AutoScrollPosition' property which
> can be used to control the viewport area.
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://classicvb.org/petition/>



  Reply With Quote
Old 09-02-2006, 10:02 PM   #4
JezB
Guest
 
Posts: n/a
Default Re: Programatically scrolling a container

Seems this does NOT work properly when you turn the scrollbars off on the
panel (AutoScroll=false). It does up to a point, but at a certain point it
stops scrolling as it is told to! Turn AutoScroll on again and it does, but
I really don't want to display scroll bars!

"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:OyYnLcYLGHA.648@TK2MSFTNGP14.phx.gbl...
> "JezB" <jezbroadsword@blueyonder.co.uk> schrieb:
>>I want a container in which I can control the scrolling programatically.
>>So it will act like a "window" on top of a larger canvas, with my code
>>controlling where the window is on the canvas. I don't think Panel will do
>>the job since you can't set DisplayRectangle programatically.

>
> Scrollable container controls have an 'AutoScrollPosition' property which
> can be used to control the viewport area.
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://classicvb.org/petition/>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off