Hi,
1) Use the SubordinateGroup and MasterGroup properties:
If (Not box.SubordinateGroup Is Nothing) Or (Not box.MasterGroup Is Nothing) Then
MsgBox ("in group")
End If
2) You can get it through MasterGroup too:
Function GetContainer(ByVal child As box) As box
If child.MasterGroup Is Nothing Then Exit Function
If Not TypeOf child.MasterGroup.MainObject Is box Then Exit Function
Dim b As box
Set b = child.MasterGroup.MainObject
If b.Style = bsContainer Then Set GetContainer = b
End Function
3) Do you move them out of the container, or they stay inside? If the former, the child nodes will be detached from the container.
4) That seems to work in my test, and also adding boxes interactively does not destroy the group:
\Dim ctr As box
Set ctr = fcx.CreateBox(30, 30, 400, 200)
ctr.Style = bsContainer
ctr.AutoResizeContainer = True
ctr.LayoutStyle = lsCustom
Dim g2 As group
Set g2 = fcx.CreateGroup(ctr)
Dim bb As box
Set bb = fcx.CreateBox(50, 260, 50, 50)
g2.AttachToCorner bb, 0
fcx.CreateBox(60, 60, 30, 30).PutInContainer ctr
I hope that helps,
Stoyan