Solved

VB Application on Laptop

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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.
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…

895 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

15 Experts available now in Live!

Get 1:1 Help Now