[Gambas-user] Toolpanel Children Resize Problem

Benoit Minisini gambas at ...1...
Wed Aug 24 19:26:36 CEST 2005


On Tuesday 23 August 2005 20:25, Alex Schaller wrote:
> Hello!
>
> I am trying to automatically resize controls inside a Toolpanel and ran
> into the following problem. Any control that is not inside Toolbar-0 does
> not automatically resize.
> Here is some sample code that I used.
>
> PUBLIC SUB Form_Resize()
>
>   DIM cControl AS Control
>
>   Toolpanel1.Width = ME.ClientWidth
>   Toolpanel1.Height = ME.ClientHeight
>
>   FOR EACH cControl IN Toolpanel1.Children
>      cControl.Width = Toolpanel1.ClientWidth
>      cControl.Height = Toolpanel1.ClientHeight
>   NEXT
>
> END
>
> Thanks!
>
> Alex
>

I think I have found your problem :-)

The Children propery of TabStrip-like containers return only visible children, 
i.e. children in the visible pane.

To get all childrens, you must do:

FOR I = 0 TO ToolPanel1.Count - 1
  FOR EACH cControl IN Toolpanel[I].Children
     cControl.Width = Toolpanel1.ClientWidth
     cControl.Height = Toolpanel1.ClientHeight
  NEXT
NEXT

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list