Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scroll bars

Status
Not open for further replies.

kimprogrammer

Programmer
Sep 15, 2008
160
CA
Hello
I have form that doesn't always show up nicely on the screen when I put it on different users screens.
I was asked that maybe i could put in horizonal and vertical scroll bars.
I don't see them in the control list.

But I do have some properties on the form that i thought would take care of this issue.
Autoscroll = true
Autosize = true

Is there something else that I'm missing

Thanks for the help
Kim
 
You should use Auctoscroll = True. And leave off Autosize = True. Is it not working for you?
 
I had Autoscroll = true and Autosize = true and there were no horizontal or vertical scroll bars.

I just changed it to Autoscroll = true and autosize = false
(i wasn't sure when you wrote "And leave off Autosize = True"_ means you meant it to be false)
But still I see no scroll bars

If that is all you do then no; it doesn't apprear to be working. I should see them even if the form fits well in my screen right?

Thanks for the help
Kim
 
I have controls on this form that are done in the designer and at run time - that shouldn't make any difference?

Thanks for the help
Kim
 
You only get them if some controls are outside of the bounds of your form.
 
Just so I'm clear - if I have all my contols within my form (which they are) I will never see the scroll bars - so it is a different issue when I put this project onto another machine and the whole form does not fit.

Thanks for the help
Kim
 
It's the same issue, it's just that you need to have the form sized correctly if it's too large for the screen.

One way to get around this is to size the form on Form_Load if needed with some simple code such as the following:

Code:
        If My.Computer.Screen.Bounds.Height < Me.Height Then
            Me.Height = My.Computer.Screen.Bounds.Height - 100 'Or some other number
        End If

And you would still keep your AutoScroll set to true.

You could also look into the AutoScaleMode property.
 
Great thanks - I went with the easy approach - I still don't have my head wrapped around instances which is included in the autoscalemode example.

I made the assumption that you needed an if statement for the width as well.

Thanks for the help
Kim
 
I haven't used the AutoScaleMode yet either. Another approach would be to set the WindowState to maximized if you detect a smaller resolution. However, if the user chose to restore the form, it would become large again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top