1. Kari Paukku
  2. PowerBuilder
  3. Thursday, 12 October 2023 08:20 AM UTC

Hi,

I don't appear to be able to figure out how to get the MDI Frame position in relation to the display it is shown.

What I would need to know is that, if the user moves the frame,  how far is the frame e.g. from the left side of the monitor edge.

Thanks,

Kari

 

Accepted Answer
Andreas Mykonios Accepted Answer Pending Moderation
  1. Thursday, 12 October 2023 09:32 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi.

A very basic way to get the information is as follows:

environment lnv_env

getenvironment(lnv_env)

// Your screen resolution.
messagebox("", string(lnv_env.screenwidth) + " / " + string(lnv_env.screenheight))

// Positions of a frame called w_frame...
messagebox("", string(UnitsToPixels(w_frame.x, XUnitsToPixels!)) + " / " + string(UnitsToPixels(w_frame.y, YUnitsToPixels!)))
messagebox("", string(UnitsToPixels(w_frame.width, XUnitsToPixels!)) + " / " + string(UnitsToPixels(w_frame.height, YUnitsToPixels!)))

You should be aware that in case you have more than one displays, this will work for the display where your application shows...

With that information you can do your calculations.

Andreas.

Comment
  1. Kari Paukku
  2. Thursday, 12 October 2023 11:48 AM UTC
Andreas,

Thanks, that helped me to solve my issue. Had altogether forgotten the getenvironment-thing.

Kari
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.