?
Solved

VB Application on Laptop

Posted on 1998-09-29
5
Medium Priority
?
177 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 40 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

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month15 days, 22 hours left to enroll

850 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