Solved

VB Application on Laptop

Posted on 1998-09-29
5
174 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 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

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.
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

728 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