Showing results for 
Search instead for 
Did you mean: 

change resulution

0 Kudos

Hello everyone ,

Does any one know how can I change the application to fit to user resolution screen ?

my app's developed in 768X1024 in original , if user works with 1280X1024 or more , it really gets hard to see , not to talk that in

wide screen it gets worst

working with 12.5 classic



Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

While you're at it you may also want to consider your users having multiple monitors in different resolutions and/or orientations and test for these scenarios.

Former Member
0 Kudos

Using 12.5.2 Classic this is how I handle the screen resolution (probably not the best way, but it works for us):

Environment lenv_obj

Long li_screenheight, li_screenwidth, li_x, li_y

GetEnvironment (lenv_obj)

// Determine current screen resolution and validate

li_screenheight = PixelsToUnits (lenv_obj.screenheight, YPixelsToUnits!)

li_screenwidth = PixelsToUnits (lenv_obj.screenwidth, XPixelsToUnits!)

If Not (li_screenheight > 0) or Not (li_screenwidth > 0) Then


End If

// Get center points

If li_screenwidth > This.Width Then

  li_x = (li_screenwidth / 2) - (This.Width / 2)

End If

If li_screenheight > This.Height Then

  li_y = (li_screenheight / 2) - (This.Height / 2)

End If

// Center window

This.Move (li_x, li_y)

We use that to center the application on the screen. but it can be modified to do whatever you want really.

This is called for every open() event on a window.

You can then go and perform any necessary manipulations required using the li_screenheight/width (the width/height of the monitor (screen resolution) and the This.Width/This.Height (the width and height of the application window.

Rather than using it to find the center of the screen you could do something like This.width = li_screenwidth and This.Height = li_screenheight to make your application window full screen.You will probably then have to also set your datawindows to match the same numbers, but with some kind of offset (to create a gap between the application window and the datawindow)

If it looks small, as suggested by Lars, you may also need to zoom the datawindow to make it more readable.

Former Member
0 Kudos

This will only work for one screen. If you have 2 or more monitors, you have to use some API functions (EnumDisplayMonitors) to get the geometry and dimensions of the monitors.

Former Member
0 Kudos

Any chance of moving to PB.Net? WPF makes screen resolution almost irrelevant.

Former Member
0 Kudos

dw_1.Modify ( 'datawindow.zoom=120' )