StarBasic FAQWissen, das weiterhilft.

Dialoge/Formulare

Wie kann man auf Unterformulare zugreifen?

Ein Unterformular ist ein Element des Hauptformualars und wird genau wie ein Kontrollelement angesprochen:

Basic
  odoc=thisComponent
  odraw1=odoc.drawpage
  form1=odraw1.forms.getbyIndex(0)
  osubform=form1.getbyname("SubForm")

Um die Unterformulare aufzulisten muss die Elemente de Hauptformulares prüfen:

Basic
  form1=odraw1.forms.getbyIndex(0)
  for i=0 to form1.count-1
    oform=form1.getbyindex(i)
    if oform.SupportsService("com.sun.star.form.component.DataForm") then msgbox "Subformular"
  next i