|
-
March 26th, 2001, 05:21 AM
#1
UI for different Screen Resolutions
Is there any way that my mdi application remains the same(controls positioning and size ratios) in different screen resolutions.
-
March 26th, 2001, 05:35 AM
#2
Re: UI for different Screen Resolutions
Hi.
There are ActiveX's that will do it for you.
Search for 'axs_resizer'
The other method is to:
1) find the new x & y factor (New size / Old size)
2) loop through all the controls on the form and then multiply the top and or height with the y factor and the left and the width with x factor.
You should decide if you are going to multiply the fontsize with the y the factor as well.
Certain controls (ie: menu) do not allow these maniplations, so be sure to add the line :
On Error Resume Next
to the code before you loop through the controls to set their new values.
-
March 26th, 2001, 07:42 AM
#3
Re: UI for different Screen Resolutions
hi.
Thanks for the help.
But i can't consider to adjusting forms and controls at run-time since the app has around 30 forms with different types of controls one global function in bas module might be difficult.
Can you please tell me where to find axs_resizer.
bye
-
March 26th, 2001, 08:16 AM
#4
Re: UI for different Screen Resolutions
It is much easier than you think
All you have to do is:
1)Pass the form as a form (Me ---> ME as form)
2)I would have declared the Factor variables as Public
3)Use the sysinfo1 control(only once on the MDI) and on change, you recalculate the factors
2)The code does not look for type of controls, you loop through ALL of them. If it can apply the changes, it will, if it doesn't, it will move on to the next)
Here is what you do
------------------------------------------------
Private Sub Resize_Form (frm as Form)
On Error Resume Next
Dim Ctrl as Control
For Each Ctrl In frm
Ctrl.Height = Ctrl.Height * NewScaleY
Ctrl.Top = Ctrl.Top * NewScaleY
Ctrl.Left = Ctrl.Left * NewScaleX
Ctrl.Width = Ctrl.Width * NewScaleX
Ctrl.FontSize = CInt(Ctrl.FontSize * NewScaleX)
Next
End Sub
-------------------------------------------------
Here us the link to the OCX
***** http://axsoft.hypermart.net
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|