[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 138
  • Last Modified:

Form expansion

How to make up and down scroll bar to show the entire form of the project?
My project has a lot of command button that accommodate the entire form. I need to expand it but i do not know how? Please give me some ideas or example on how to make it...
Thanks
0
Whing Dela Cruz
Asked:
Whing Dela Cruz
  • 3
  • 2
1 Solution
 
GrahamSkanCommented:
You could put the controls on a frame and vary the value of the frame's Top property with the value of a vertical scroll bar.
0
 
GrahamSkanCommented:
Another idea is to use a tab control and to group the controls on different tabs.
0
 
Whing Dela CruzAuthor Commented:
can you give me some examples? i do not know how to start it!
thanks!  
0
 
GrahamSkanCommented:
OK. I will assume that you want to use the first suggestion.
Select the existing controls. Cut (Ctrl+X) them to the clipboard.
Place a large frame control on the form. Then paste (Ctrl+V) the orginal controls on to the frame. If necessary, you can adjust the frame height in the properties window so that it is larger than the form.

There isn't all that much code.
Option Explicit
 
Private Sub Form_Load()
    'Frame1 is larger than the form.
    'Let the scroll bar span the difference
    VScroll1.Max = Frame1.Height - Form1.ScaleHeight
End Sub
 
 
Private Sub VScroll1_Change()
    Frame1.Top = -VScroll1.Value
End Sub

Open in new window

0
 
Whing Dela CruzAuthor Commented:
Thanks so much!
The code is working and i'm now starting my program..
thanks! more power!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now