Change base form location

Hello everyone,

I’m looking for a possibility of being able to change the Base form size, location on monitor, zoom factor, etc programmatically on the fly… forms created through IDE.

I’ve tried to gain access through both external (open document event) and internal events (when loading), and going to ThisDataBaseDocument.FormDocuments… so far no luck. Could someone please point me in the right direction? Thank you in advance.

Have a look at Base Guide: Showing Forms …

Indeed! I must have been truly tired. Instead of going through StarDesktop, one can also pick this up by using the event parameter: oEvt.Source.CurrentController.Frame.

Nonetheless, I am still not able to set the position of the form itself, with respect to the screen. I tried setting it through the following setting, but it seems they are read only:

oEvt.Source.CurrentController.Frame.ContainerWindow.PosSize.x/.y
oEvt.Source.CurrentController.Frame.ContainerWindow.AccessibleContext.LocationOnScreen.x/.y

Take oEvt.Source.CurrentController.Frame.ContainerWindow.setPosSize(0,0,600,400,15) as described in the documentation.
‘15’ is only a flag. Say here: all values should be changed - x, y, width and height -

Might be you will need resolution of screen:
oEvt.Source.CurrentController.Frame.ContainerWindow.Info.PixelPerMeterX * 2.54/100)
If I create windows without looking for this resolution they might be too small on newer laptops.

1 Like

Amazing, thank you once again. Danke Schoen!! :+1: :grinning: