I try to use Container Controls in a project. To test the use of Container Controls I designed one ContainerControl1 with one PushButton (PushButton1). In the IDE I put ContainerControl1 on a Window. No problems until now… Now, I try to change the caption of PushButton1 in the open event of the Window by:
dim cc as new ContainerControl1
cc.PushButton1.caption="test"
Once the ContainerControl is placed on the window, you just interact with it like any other control, so so need for the DIM statement (which is creating a new ContainerControl1 in memory not referring to the control on the window)…
This solves the problem. And one more related question: I put Label1 in ContainerControl2. Now I want to put a variable number (a dynamic String Array) of labels based on Label1 of ContainerControl2 on a window during runtime. What’s the most efficient way to do that? Do you have some example code?
I think using a control set is the best way, but in all honesty, have not gotten around to using them myself… In the User Guide Book 2: User Interface" PDF if you go to section 2.16 Control Sets and Dynamic Controls that should help you a bit more…
Control sets are a very strange way of defining dynamic arrays of controls. However, it works… XOJO is good programming language to develop multi-platform applications, but the effort to learn the language is very high.