473,383 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Making an application the same size in all resolutions

vdraceil
236 100+
Hi everyone, i made an application with vb6 in my pc,but when i transferred it to a laptop,the relative positions of controls has changed..it seems it has something to do with the resolution..got any solution?
Aug 10 '08 #1
7 5008
debasisdas
8,127 Expert 4TB
You ned to resize the form as per monitor resolution.
Aug 11 '08 #2
vdraceil
236 100+
You ned to resize the form as per monitor resolution.
how do i do that?pls help..
Aug 12 '08 #3
vdraceil
236 100+
I know how to change the resolution of the system as a whole..but i dont know how to make the form look same in all kind of resolutions..-i mean we should not change the computer's resolution only because our form has to run properly.. Got any ideas?
Aug 12 '08 #4
debasisdas
8,127 Expert 4TB
findout the resolution of the monitor and resize the form and other controls accordingly.
Aug 12 '08 #5
vdraceil
236 100+
findout the resolution of the monitor and resize the form and other controls accordingly.
thanks for ur reply..
after finding out the resolution of the monitor,what do i do?
how do i size my form accordingly?i mean what size should i hav for one resolution and what for some other resolution?
how do i proceed??
an example would help..
Aug 19 '08 #6
This code from Jim Cone worked for me...

Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long

Sub ResizeForm_R1()
' Adjusts userform size to compensate for screen resolution changes.
' Calls function GetSR
' Jim Cone - San Francisco, USA - Dec 2006
Dim varSize As Variant
Dim RatioX As Single
Dim RatioY As Single
Dim ActualX As Long
Dim ActualY As Long

'Screen resolution in development environment.
'Adjust as necessary <<<
Const BaseX As Long = 800
Const BaseY As Long = 600

'Call function to get actual screen resolution
varSize = GetSR
ActualX = varSize(0)
ActualY = varSize(1)

'Determine ratio of actual screen resolution to
'the original or base resolution.
RatioX = ActualX / BaseX
RatioY = ActualY / BaseY

'Adjust userform magnification and size.
UserForm1.Zoom = (100 * ((RatioX + RatioY) / 2))
UserForm1.Width = UserForm1.Width * RatioX
UserForm1.Height = UserForm1.Height * RatioY
UserForm1.Show
Unload UserForm1
Set UserForm1 = Nothing
End Sub

'---------------------------------
Public Function GetSR() As Variant
' x and y
GetSR = Array(GetSystemMetrics(0), GetSystemMetrics(1))
End Function

thanks for ur reply..
after finding out the resolution of the monitor,what do i do?
how do i size my form accordingly?i mean what size should i hav for one resolution and what for some other resolution?
how do i proceed??
an example would help..
Aug 19 '08 #7
vdraceil
236 100+
This code from Jim Cone worked for me...

Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long

Sub ResizeForm_R1()
' Adjusts userform size to compensate for screen resolution changes.
' Calls function GetSR
' Jim Cone - San Francisco, USA - Dec 2006
Dim varSize As Variant
Dim RatioX As Single
Dim RatioY As Single
Dim ActualX As Long
Dim ActualY As Long

'Screen resolution in development environment.
'Adjust as necessary <<<
Const BaseX As Long = 800
Const BaseY As Long = 600

'Call function to get actual screen resolution
varSize = GetSR
ActualX = varSize(0)
ActualY = varSize(1)

'Determine ratio of actual screen resolution to
'the original or base resolution.
RatioX = ActualX / BaseX
RatioY = ActualY / BaseY

'Adjust userform magnification and size.
UserForm1.Zoom = (100 * ((RatioX + RatioY) / 2))
UserForm1.Width = UserForm1.Width * RatioX
UserForm1.Height = UserForm1.Height * RatioY
UserForm1.Show
Unload UserForm1
Set UserForm1 = Nothing
End Sub

'---------------------------------
Public Function GetSR() As Variant
' x and y
GetSR = Array(GetSystemMetrics(0), GetSystemMetrics(1))
End Function
This is only to keep a constant size form,isnt it?
Will it work for other controls too?
(I've not tried it yet)

Expand|Select|Wrap|Line Numbers
  1. UserForm1.Zoom = (100 * ((RatioX + RatioY) / 2))
Considering the above code,in vb6, a form doesnt have a "zoom" property!!
Aug 24 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

21
by: James Moe | last post by:
Hello, I just joined this group and saw the discussion "What do you think of resizing 1em to 10px?" I am somewhat confused by what y'all think should be used as a reference size. I was surprised...
23
by: BobK | last post by:
Hello Everyone, I am updating the CSS for my site but want new and original page to appear the same. My original CSS permits small increments of zooming (ctrl/mouse wheel) so that you get...
9
by: Les Juby | last post by:
I understand that there are several ways to effectively control the browser delivery of HTML to make the most effective use of the different screen resolutions today. (And in the foreseeable...
5
by: VMI | last post by:
I have a BMP image (the form is also in PDF) that contains a scanned copy of a paper form that we need to fill out. Is it possible to use this image in my application so that the application can...
2
by: Tina | last post by:
As I design my page, I want to make sure it looks good if the Text Size is set to largest in the I.E browser. How can I set my design view so object appear that way as I build my page? Thanks, T
1
by: Marvin Zamora | last post by:
I am making a screen saver, but I don't know how to resize the form to take on the size of the screen. It doesn't seem like I can set it explicitly in the properties menu of the form because...
3
by: phil-news-nospam | last post by:
Here's an example I found on another site. I was visiting the site named in the URL in this image, and got the registrar's site because the domain had apparently expired. Look at the boxes along...
0
by: Tineke | last post by:
Hello, I'm helping to develop an application at this moment in .NET (still 2003). Now we have different users from different countries that use this application. On one page we have a...
5
by: =?Utf-8?B?UmljaA==?= | last post by:
Hello, If I create a form in Java with controls like Panels, textboxes... when I stretch/shrink the form, all the controls can grow/shrink - along with the text contained in the textboxes. This...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.