Solved

VB Application on Laptop

Posted on 1998-09-29
5
168 Views
Last Modified: 2010-05-03
When I run my vb  exe. on my laptop half the form is missing.
0
Comment
Question by:Amanda080598
  • 2
  • 2
5 Comments
 
LVL 6

Expert Comment

by:clifABB
ID: 1437253
Do you mean the form is too big for the screen, or the form is being cut off in the middle of the screen?
0
 
LVL 12

Accepted Solution

by:
mark2150 earned 20 total points
ID: 1437254
Chances are that your laptop doesn't have the screen resolution that your desktop did. When you run it on the laptop all cannot be displayed.

Two possible solutions:
1) write a bunch of code to resize everthing at FORM_LOAD time
2) Go back into VB and use the screen viewer tool to make sure forms all fit within 640x400 or whatever your laptop is running.

0
 

Author Comment

by:Amanda080598
ID: 1437255
mark2150,

What code do we did to use as you mentioned above?

Amanda
0
 

Author Comment

by:Amanda080598
ID: 1437256
The form is too big for the screen.
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1437257
When you do the form load you need to resize the form and all of the controls proportionally. This is a major pain. Better to resize the form to run on 640x400 and then you'll be ready to roll from that point out.

If you feel that you must resize to fit, you'll have to do some homework - this next is done on *PAPER* not in *CODE!. Figure out the size of your form (.Width/.Height). Then divide each control's .Width and .Height by the forms .Width & .Height. This will give you the control size as a percentage of the form size. Ditto for the .Left and .Top properties. This will give you a relative position.

Once you have worked all of these values out on paper you can then place appropriate inline code in the Form_Load event to size the controls to the form.

wide = Screen.Width       'Figure out screen dimensions & save in work vars for speed
high = Screen.Height
Me.Width = wide           'Grow form to screen size
Me.Height = high
Control1.Width = wide * ctl1scalewidth    ' scale controls
Control1.Height = high * ctl1scaleheight
.

repeat for all controls on form

ctl1scalewidth/height are constants you defined from doing the desk work.

The only other problem area is setting the font sizes in the controls. You can try to do this dynamically or just use a font that is small enough for 640x400. It may get "lost" when you scale up to 1280x800 tho.

M

0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

706 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

19 Experts available now in Live!

Get 1:1 Help Now