Syntax question for tabpanel

I am stuck on a syntax question. I have a tab panel with several pushbuttons. From the main window I would like to reference the buttons. I looked at the man page for tabpanel the syntax I was looking for.

I tried

tabpanel1.firsttab.button.Caption = “string”

Where can I find a syntax example for this in the LRM?

If the 'main window" is where the tab panel & button are then try
button.Caption = “string”

Hi Glenn, you don’t need to do that. just do as follow

button1.Caption = “string”
button2.Caption = “string”
button3.Caption = “string”

If you really do need to identify all the controls that are tied to a specific index on a TabPanel, this code will do it:

Function ControlsOnTabPanel(panel As TabPanel, panelIndex As Integer) As RectControl()
  dim r() as RectControl
  
  dim w as Window = panel.Window
  dim lastIndex as integer = w.ControlCount - 1
  for i as integer = 0 to lastIndex
    dim c as Control = w.Control( i )
    if c IsA RectControl then
      dim rControl as RectControl = RectControl( c )
      if rControl.Parent = panel and rControl.PanelIndex = panelIndex then
        r.Append rControl
      end if
    end if
  next
  
  return r
  
End Function

It will return an array of RectControl. From there, you can find the control or controls your need by looping through them, or you can refine this code with Introspection or something.

I understand now. The buttons are really just sitting inside the main window and not inside the tab panel.

How do we get this added to the man page on tab panels?

THanks

I’ve added a note about this to the Language Reference and User Guide topics for Page Panel and Tab Panel.

Thanks