Solved

Scrolling on VB form

Posted on 2006-11-25
7
254 Views
Last Modified: 2010-04-30
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?
0
Comment
Question by:k3n51mm
  • 4
  • 2
7 Comments
 
LVL 5

Expert Comment

by:Alkali_Guy
ID: 18012949
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.
0
 
LVL 1

Author Comment

by:k3n51mm
ID: 18016519
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
0
 
LVL 1

Author Comment

by:k3n51mm
ID: 18016582
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.



0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 15

Expert Comment

by:Ryan_R
ID: 18017220
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
0
 
LVL 1

Author Comment

by:k3n51mm
ID: 18023970
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?

0
 
LVL 5

Accepted Solution

by:
Alkali_Guy earned 500 total points
ID: 18024336
Try not moving the radio buttons that reside in frames.  They should move along with the frame automatically.
0
 
LVL 1

Author Comment

by:k3n51mm
ID: 18024542
thanks AG
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now