Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VB Application on Laptop

Posted on 1998-09-29
5
Medium Priority
?
176 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

609 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