Adjust size and placement of a form in Base

After some searching, I found a routine that should check the size and placement of a (base) form. A note was posted elsewhere that this would not work properly in Release 6.3.

I use the following code (when opening the Document):

 oCurrentController = ThisComponent.getCurrentController()
 oFrame = oCurrentController.getFrame()
 oContainerWindow = oFrame.getContainerWindow()
 oContainerWindow.setPosSize(295,0,850,1330,3)

This gives no error, but does not work (at all).
However: The ** X position ** does ** work **, but the rest does not, as far as I can tell.
The size of a form can be adjusted online (in design and during execution) and will be used next time.
Whether the same size is also used for other forms, I have not yet determined.

Is this indeed a bug, or am I (as a new OO user) doing something wrong?

Hello,

This is an English site. For Dutch see → https://ask.libreoffice.org/nl/questions/scope:all/sort:activity-desc/page:1/

Otherwise re-post in English by editing this question (not a new post).

Your problem can be solved.

Edit: Have translated for you. In future post in English on this site.

Hello,

There are multiple problems with form size and screen placement. For reference, and further explanation of the problems, see answer in this post → Open a Base Form in a window

Have since modified the routine to make the positioning optional.

Here is the main routine:

Sub Resize(iWidth,iHeight,Optional iXPos,Optional iYPos) As Integer
REM      This cleans up the dead space
	Dim vRect as Object
	If IsNull(thisComponent.currentController.Frame) then exit sub
	vRect = thisComponent.currentController.Frame.ContainerWindow.PosSize
    Wait 200
    If IsMissing(iXPos) Then iXPos=vRect.X
    If IsMissing(iYPos) Then iYPos=vRect.Y
	thisComponent.currentController.Frame.ContainerWindow.setPosSize(iXPos, iYPos, iWidth, iHeight, 15)
    Wait 200
	thisComponent.currentController.Frame.ContainerWindow.setPosSize(iXPos, iYPos, iWidth, iHeight, 15)
End Sub

Now each form, with its own settings, can use a call to this routine with:

Sub SetYOURFORM
    Resize(850,1330,295,0)
End Sub

I used your settings (you should double check these) in the example. This second sub is then attached to the Open Document event of the form.

Note: Wait 200 (occurs in two different lines) works on my system. You may need to increase by 100-200 if the routine doesn’t seem to work.

I have applied these setting in my application and am happy te see that this works exactly as intended.

Thanks very much for your help!