473,386 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Panel & external VScrollBar

Hello !

I'm trying to combine an external (not part of the panel)
vertical scrollbar (VScrollBar) with a panel in order to
scroll the content of the panel vertically using the external
VScrollbar. I can't set the "AutoScroll"-property to true and
then use the generated scrollbars inside the panel,
because i have to use this external scrollbar which is a
modified/customized scrollbar, and doesn't look like a
standard scrollbar.

I've experiemented a litte bit, but until now i'm quite unsure.
What is a good way to to achieve this?
Source samples are highly appreciated.

Thanks in advance and have a nice weekend !
Sascha

Nov 17 '05 #1
2 5998
Sascha,

I would have a property on the Panel (or take these values in the
constructor, assuming that you are deriving your class from Panel) which
takes the scrollbars that are to be used to manipulate the view. Then, you
can attach to the events indicating that the value of the scrollbar changes,
and adjust your view appropriately.

Either that, or expose a method where you can set what the panel is
viewing and have the event handler for the container control link the two
together when the scrollbars change.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Sascha Schmidt" <Sa****@nospam.de> wrote in message
news:da**********@mail.lachmann-rink.de...
Hello !

I'm trying to combine an external (not part of the panel)
vertical scrollbar (VScrollBar) with a panel in order to
scroll the content of the panel vertically using the external
VScrollbar. I can't set the "AutoScroll"-property to true and
then use the generated scrollbars inside the panel,
because i have to use this external scrollbar which is a
modified/customized scrollbar, and doesn't look like a
standard scrollbar.

I've experiemented a litte bit, but until now i'm quite unsure.
What is a good way to to achieve this?
Source samples are highly appreciated.

Thanks in advance and have a nice weekend !
Sascha

Nov 17 '05 #2
Hello again!

To describe my problem more precisely:
It's more a technical than an architectical problem.

Until now i discovered two ways to manipulate the "scroll-position"
of the frame:
Using window messages to move one line up and down, for example

SendMessage(pnlScroll.ThePanel.Handle, WM_VSCROLL, SB_TOP, new
IntPtr(0));

or modify the coordinates of the property "AutoScrollPosition"
in the "Scroll"-Event of the external scrollbar like :

private void sgvScrollBar1_Scroll(object sender,
System.Windows.Forms.ScrollEventArgs e)
{
int modifFactor = 3;
pnlScroll.ThePanel.AutoScrollPosition = new Point(0, e.NewValue *
modifFactor);
}

Both solutions provide scrolling, but until the "AutoScroll" - property
is set to true (i can't do this, you remember ?) both can't scroll
completly down to the bottom (they stop about 2/3 of the way).

I changed the "modifFactor", but that doesn't change.

So my remaining questions are:
1) How do i get a scroll solution that is fully functional
(among other things: Scroll fully to bottom) ?
2) How do i calculate the "min" and "max" property for
the external Scrollbar, so that it fits to the size of
the panel ?
3) Is the event "Scroll"-event of the scrollbar the right
one for this purpose? Do i need other properties / events
of the scrollbar?

Again, thanks in advance
Sascha
Nicholas Paldino [.NET/C# MVP] schrieb:
Sascha,

I would ...

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kristof Nachtergaele | last post by:
Hi, I'm looking for something, which acts as a container, that I can drop onto my form and which has a size that is bigger than the visible part, the invisible pazrt being scrollable to with...
0
by: Marco Rego | last post by:
I need to set the SmallChange property of the VScrollbar of a Panel (AutoScroll = true), but I donīt see how to access it. Thanx for any help and God bless. _____ Marco
1
by: Dmitri Shvetsov | last post by:
Hi All, Did somebody play with vScrollBar in C#? I've got a small trouble. When I assign the Maximum value and try to move the slider of the vScrollBar to a maximum position I can't get the...
0
by: bleedledeep | last post by:
I have a DataGrid that ends up with a VScrollBar due to the number of rows, and the behavior I want is for the bottom-most row of the DataGrid to be shown, i.e., I want the VScrollBar all the way...
2
by: YYZ | last post by:
I discovered something very interesting today, and it will save me a bunch of time...maybe. If you set Panel1.Autoscroll to true, and have a panel2 inside of it, I can add all sorts of controls...
1
by: Atul | last post by:
Hi All, I have a panel on which various components are placed. I now need to scroll the panel vertically using an exteranal VScrollBar component. Please help me with the code on how this can be...
0
by: mahaq | last post by:
Hi Guys, I like to know if there is any better solution to this issue. I am a front end developer using CSS and asp.net technologies I have a .net page and I am using an external CSS file....
1
by: =?Utf-8?B?U2hhcm9u?= | last post by:
I'm using the System.Windows.Forms.VScrollBar on my form. I'm handling VScrollBar Scroll event. I want to handle the Up, Down, PageUp PageDown keys for this VScrollBar, but when I register to...
1
by: eBob.com | last post by:
I have two apps, both developed using the same VBE, and both having a VScrollBar, but the two VScrollBars have very different styles. (In the screen shot, which I had hoped to attach but can't,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.