Estoy necesitando hacer conteo de botones en un dialog y luego revisar el tipo de cada boton
Lo estoy intentando con este codigo.
Código: Seleccionar todo
sub contando_elementos_en_dialog_0
' LO 4.7.2
' El Dialogo
Globalscope.BasicLibraries.LoadLibrary( "MRILib" )
DialogLibraries.LoadLibrary("Standard")
Dlg = CreateUnoDialog(DialogLibraries.Standard.Dialog1)
Dlg.getPeer().setProperty( "NativeWidgetLook", False ) ' activar cambio de colores en los botones
dlgmodel = dlg.getModel()
'' contando los botones del dialog
' mri Dlg.Model
' esto si funciona
num_botones =Dlg.Model.ElementNames
msgbox UBound(num_botones)+1
mensaje=""
For i = 0 to UBound(num_botones)
boton = Dlg.Model.getByName(num_botones(i))
tipo= boton.ImplementationName
boton.Align=1
mensaje=mensaje & i & ", " & tipo & chr(13)
' mri boton
' msgbox boton.Name & ", " & boton.Height & ", " & boton.Width
next i
Dlg.Model.removeByName("222")
msgbox mensaje
'Enumeration: este no funciona
'
' oEnum = Dlg.Model.createEnumeration()
' While dlgmodel.hasElements
' Frm = oEnum.nextElement()
' msgbox Frm.Name ', Frm.Size.Height, Frm.Size.Width
' WEnd
dlg.execute()
end sub
Mis agradecimientos