Click to See Complete Forum and Search --> : UI for different Screen Resolutions


Adhi Sheshu
March 26th, 2001, 04:21 AM
Is there any way that my mdi application remains the same(controls positioning and size ratios) in different screen resolutions.

wbeetge
March 26th, 2001, 04:35 AM
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.

Adhi Sheshu
March 26th, 2001, 06:42 AM
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

wbeetge
March 26th, 2001, 07:16 AM
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