How to rearrange the order/list of the button/imageBox/others in a Dialog ?

Hello all,
I edited a Dialog with imageboxes with some buttons on the image. ie.
Screenshot 2024-09-04 at 01.12.41
However, the order to display the objects are inverted.
Screenshot 2024-09-04 at 01.14.05

Of course, I can rearrange the buttons, images, or whatever in the design mode in order to get the expected outlook. But can you help me to rearrange the view-order by using the methods (functions) or by changing the properties in macros (LibreOfficeBasic)

By simple code looks like the following:
oDialogModel = oDialog1.getModel()
oImageModel = oDialogModel.getByName (“ImageControl2”)
oImageModel.ImageURL = sURL
oImageModel.EnableVisible = True
oImageModel.ScaleImage = True

REM Arrange the ImageControl2 send to the background
REM code may look like this or by calling a SUB
oImageModel.SendToBack = True

Thanks in advance and sorry if this question was already posted before.
Andy

so, what is your question exactly ?

maybe this can help : Selecting background image with a macro in calc - #3 by gastcra

// can you help me to rearrange the view-order by using the methods (functions) or by changing the properties in macros (LibreOfficeBasic) //

The example of buttons shows how to do this.
Run the “ShowDialog” macro in the attached file.
When you click on any of the buttons, it will be brought to the foreground.

Option Explicit

Dim oDialog As Object

Sub ShowDialog
  Dim retval
  DialogLibraries.LoadLibrary("Standard")
  oDialog=CreateUnoDialog(DialogLibraries.Standard.Dialog1)
  oDialog.execute()
End Sub

Sub OnClick(oEvent)
  Dim oModel As Object, oControl As Object
  oModel=oEvent.Source.Model
  For Each oControl In oDialog.Controls
    oControl.Model.TabIndex=IIf(oControl.Model.Name=oModel.Name, 0, 1)
  Next oControl
End Sub

TabIndex.ods (11.3 KB)