Link to home
Start Free TrialLog in
Avatar of k3n51mm
k3n51mm

asked on

Scrolling on VB form

I am modifying an existing VB6 program that runs on a specialized type of fieldwork PC. It runs Windows 2000 Pro, but the Windows desktop interface is accessed via a lightpen and a small virtual keyboard. In addition, the physical screen size of the PC is 800 x 600 (though the resolution is higher). Therefore, the application has rather small windows and frequently displays a wizard-like interface.

All that having been said, I am constructing a rather complex form to add to the application. It is an electronic version of a hardcopy form that is used in the client's office. They have requested that the electronic version exactly mimic the hardcopy version, to ensure no learning curve for technicians in the field.

All well and good so far - but their hardcopy form has 2 pages to it. I've made it mostly through the first page, adding labels and textboxes where necessary. But, VB6 is not allowing me to vertically resize the form any larger than 15360 twips. NOTE: Horizontal size is not excessive, therefore not a problem.

I have already added a scroll bar to the form, to enable the technicians to see the whole thing but not all at once - keeping the form in a manageable desktop area is vital.

QUESTIONS:
How can I size the form to a certain size, focused at the top, when loaded, thereby forcing the user to scroll down to see the rest of the form?

Why is Visual Studio not allowing me to resize it any taller at design time?

If this form MUST be split into more forms, what are the best practices for this?
Avatar of Alkali_Guy
Alkali_Guy

Design the form at full size, putting all controls in a borderless frame.  Then shrink the frame and the form to the size you want.  You can move the items up and down inside the frame.

I'm not sure why Visual Studio won't let you size it larger.

To split the form, you can do it wizard style: have two superimposed sets of controls on your form, plus a Back and Next button.  When the user clicks the Next button, you hide the first set of controls and show the second.  A simpler way is of course to design two separate forms that appear in sequence.  Have a "Finish" button with the second set of controls (you can rename the Next button) that the user can push to dismiss the forms.
Avatar of k3n51mm

ASKER

Please clarify your answer with more detail:
"Then shrink the frame and the form to the size you want.  You can move the items up and down inside the frame."

I don't understand why I should use a frame. Do you assume I will add a scroll bar to it? How? Why not just do this with the form itself?

thx
Avatar of k3n51mm

ASKER

Okay, since I already had a scrollbar on the form, I did not add a frame. I have resized/recentered the form at load time and it works - the scrollbar automatically sizes using the code I already had.



another approach - use a tabbed style interface (like the tabs you see in Display properties) - you could then have Page 1 on one tab and Page 2 on the other
Avatar of k3n51mm

ASKER

Thanks Ryan, but it is not up to me to redesign this app unfortunately. I have to work with it no matter how stupid it is. However, by setting a larger height in the Properties window instead of graphically, it seems to work.

But anyway, I do have another scrolling question, if you might want these 500 points.... I found scroll code here on EE, and it has worked fine till now. However, I discovered that to pair off separate Yes/No radio buttons, I had to place them inside Frames. Otherwise, clicking a YES radio button from Option12 would make Option1's NO button also deselect.

So now when I hit the scroll arrows, the radio buttons scroll out of the frames, which follow the rest of the controls on the form. Checking the radio buttons' Top attribute, they're set relative to the Frame control I suppose, since their Top values are all 0. The scroll code adjusts the Top attributes of each control on the form, thereby showing the scroll effect.

What gives, and how do I fix it?

ASKER CERTIFIED SOLUTION
Avatar of Alkali_Guy
Alkali_Guy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of k3n51mm

ASKER

thanks AG