471,330 Members | 1,350 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

intro to scrollbars

Hi all,

I'm trying to learn how to use scrollbars (in particular vertical
scrollbars) in windows forms. However every code sample I've looked at
or article I've read seems to miss out stuff.

I was wondering if anyone knows of a real dummies guide to using
VScrollBar on Windows Forms or could offer their own help?

Thanks,

John

Feb 1 '06 #1
3 1074
See over there http://www.syncfusion.com/faq/windowsforms/Default.aspx
I'm trying to learn how to use scrollbars (in particular vertical
scrollbars) in windows forms. However every code sample I've looked at
or article I've read seems to miss out stuff.


---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

Feb 1 '06 #2
Hi all,

I've read a wee bit into programming scrollbars, but I still can't
solve my problem.

I want to specify a maximum size for my form and if the largest y value
of my controls is greater than this then I want to start scrolling (and
not allow the user to increase the size).

ie.

if ((lastControl.Location.Y+lastControl.Size.Height) > maxY)
{
// set form height= maxY
// turn on auto scroll
// disable resizing
}

The following article seems to be the converse of this;

http://www.samspublishing.com/librar...seqNum=67&rl=1

but I'm still not sure what to do.

Can anyone suggets anything?

Feb 7 '06 #3
Funny how when you try to explain something to someone in order to ask
for help, you end up solving it yourself.

For anyone who may be interested, this is what I did;

1) set a maxiumum height for the Form
2) turned on autoscroll
3) // found last Control, c
int yVal= c.Location.Y + c.Size.Height;
if (yVal > this.MaxiumSize.Height)
this.Height= this.MaxiumSize.Height; // this is the form
else
this.Height= yVal + someVal; // someVal just a clearance space

easy eh?

Feb 7 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Konrad Koller | last post: by
6 posts views Thread by adrien | last post: by
24 posts views Thread by Nobody | last post: by
5 posts views Thread by Dennis M. Marks | last post: by
14 posts views Thread by Jorg Matter | last post: by
1 post views Thread by Andi Plotsky | last post: by
2 posts views Thread by needin4mation | last post: by
6 posts views Thread by shapper | last post: by

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.