[Gambas-user] How to duplicate Ctrls with properties at runtime, Thanks, work to be done ...

ub2 at gmx.ch ub2 at gmx.ch
Thu Mar 26 19:44:44 CET 2020


Dear Olivier and Lee


Thanks a lot for your ideas.

Right now your code is slightly above my head,
but I will dig into and be back probably in a few days.

Most likely it needs deciding whether I want to manage complexity
a) at the very beginning when listing, or
b) later on when accessing/calculating created lists

The project already deals with 9 lists, not too much more to come.
On the other side, calculations to be adapted upon request....

So for now, work for a) seems to smell less...


Sorry for this unspecific answer.
But your inputs already helped a lot, and will even do more.


Again, thanks for your help,
and greetings to all Gambin at s.

ub2

Am 26.03.20 um 12:00 schrieb ub2 at gmx.ch:
> Dear Gambas Cracks
>
> 2nd try, 1st see below
> (Was user at lists.gambas-basic.org partially down yesterday ?)
>
> Best regards
> ub2
>
>
> -------- Weitergeleitete Nachricht --------
> Betreff: How to duplicate Controls with all its preferences at runtime
> Datum: Wed, 25 Mar 2020 10:21:48 +0100
> Von: ub2 at gmx.ch <ub2 at gmx.ch>
> An: user at lists.gambas-basic.org
> Kopie (CC): ub2 at gmx.ch
>
> Dear Gambas Cracks
>
>
> I'm fiddling since 2 days, code explodes, and I'm sure there must be a
> better way ...
>
>
> I'd like to duplicate at runtime various Controls (different types!)
> with all it's preferences (Formatting, Pictures, etc).
>
> The situation:
> In a scrollview I have "a well prepared Master-Controls-line" like
> TglBtn_...._0 | Txta_....._0  | Txtlbl_..._0 | Pixcb_..._0 | ...
>
> In order to get new "Record-Lines" I'd like to duplicate all those
> Master-Controls them with the clumsy code partially shown in
> 	Attachement 200325...
> and access the Controls later with:
> 	$Ctrl$ = Me.Txtlbl_....._1
> 	$Ctrl$ = Me.Txtlbl_....._2
> 		...
>
> I'd like to avoid SubForms like:
>      $NewUFrm$ = New UFrmXYZ($RecNr$, ..., ..., $Scrvw$)
> because access to those new Controls becomes more complicated:
> 	$Txtlbl_...._0$ = UFrmXYZ(Me.Scrvw.Children[0]).Children[2]
>
>
> My Question:
> Is there a command like:
>     $Ctrl_New$ = NewWithPrefs Control($CtrlParent$)
>     $Ctrl_New$ = Duplicate Control($CtrlParent$)
>     ore similar
>
> Any ideas, links, keywords, etc would be highly appreciated.
>
>
> Thanks for Gambas and this very helpful community.
> Take care and stay healthy
>
> ub2
>
>
>


More information about the User mailing list