Form Control Position Size Andrew Pitonyak Paolo Mantovani How can I get the position and size of form controls?

A form control is placed on a drawing shape (com.sun.star.drawing.XControlShape), so you need to obtain the shape underlying the control to manage his size and pos.

Andrew Pitonyaks Tools Library (module "ModuleControls") supplies some facilities in order to work with form controls.

Check those functions:

Sub SeeThingProp Dim oForm, oControl, iNumControls%, i% Dim v() 'By default this is where the controls are oForm = ThisComponent.Drawpage.Forms.getByName("Standard") ' oControl = oForm.getByName("MyPushButton") oControl = oForm.getByName("CheckBox") Dim vShape Dim vPosition, vSize Dim s$, vv vShape = GetControlShape(ThisComponent, "CheckBox") vPosition = vShape.getPosition() vSize = vShape.getSize() ' RunSimpleObjectBrowser(vSize) s = s & "Position = (" & vPosition.X & ", " & vPosition.Y & ")" & CHR$(10) s = s & "Height = " & vSize.Height & " Width = " & vSize.Width & CHR$(10) MsgBox s End Sub
Initial version