• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 139
  • 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
 
GrahamSkanRetiredCommented:
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
 
GrahamSkanRetiredCommented:
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
 
GrahamSkanRetiredCommented:
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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