Move containercontrol tabpanel

Hello,

how can i move a dynamic created containercontrol which has been placed with ‘embedwithinpanel’ to another page in that pagepanel?
Controls placed on a pagepanel in the ui i can change it with 'mycontrol.panelindex(1) ’ to move that control to panel 1.

I have multiple containercontrols embedded within that pagepanel, and if the window is resized i want to move the cc that don’t fit anymore to move to the second page…

thanks,
marco

I tried to save a reference to the pagepanel into the cc so that i can access the panelindex property but still no luck…
Is it possible at all to move dynamic created controls to a different page on a pagepanel at runtime?

Thanks
Marco

got it

Sub moveToPanel(panelname as PagePanel, panelindex as integer, movetoPanel as integer)
Dim tbControls() As RectControl
Dim wnd As Window = panelname.Window
Dim lastIndex As Integer = wnd.ControlCount - 1

For i As Integer = 0 To lastIndex
  Dim c As Control = wnd.Control(i)
  If c IsA RectControl Then
    Dim rControl As RectControl = RectControl(c)
    If rControl.Parent = panel And rControl.PanelIndex = panelIndex Then
      rControl.PanelIndex=moveToPanel
    End If
  End If
Next i
End Sub

How could i extend the method above to only move a specific containercontrol to another Page? The problem with the method above is, that it moves ALL conatainercontrols from one Page to another…

Thanks Marco