[Gambas-user] How to duplicate Ctrls with preferences at runtime (2)

ub2 at gmx.ch ub2 at gmx.ch
Thu Mar 26 12:00:06 CET 2020


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



-------------- next part --------------
A non-text attachment was scrubbed...
Name: 200325-0950a_DuplCtrlsWIrhPrefs.png
Type: image/png
Size: 82549 bytes
Desc: not available
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200326/1a111052/attachment-0001.png>


More information about the User mailing list