Desiging my first app with Xojo and finding a necessary feature.
I cannot copy and past all controls to another PagePanel only to the same PagePanel. For example I need to paste all canvas buttons from PagePanel0 to PagePanel2 to save time and positioning. It works only to the same PagePanel 0 to 0.
Although copy&paste works with text labels to other PagePanels.
Can you make this work or is it a no go?
Use Container Controls.
You can re-use a container over and over, so if you have different instances of the same view you don’t have to re-do the whole thing. They’re also easier to manage inside a PagePanel, as you can get a nice view of all the controls separate from the page you’re working on.
You should be able to copy your controls from PagePanel0 to a Container Control, then duplicate that container, make your adjustments and place both containers in your PagePanel (replacing the existing controls there)
The other thing you could do is use a canvas control on each page of the pagePanel. use the canvas as a ‘parent’ for the controls on each panels.
Personally, I prefer the Container approach but using a canvas to ‘group’ your controls is another possibility.
I’ve managed to copy from PagePanel to Container and then paste Container to PagelPanel2. There is no reference i can see, that the pasted ContainerControl belongs to PagePanel2. In fact i deleted the Container control and the controls are still there on PagePanel2 and compiled and ran fine without. In the manual it says it saves code by using Container Controls. I see you can insert container with:
Dim c As New ContainerControl1
c.EmbedWithin ( self, 0, 0 )
I’m not sure if there’s a communication breakdown between us.
The PagePanel border will glow red when you’re dragging the ContainerControl inside it, this lets you know the PagePanel will be it’s parent. ContainerControls you drag onto the interface are instances of the one you designed, meaning that you would refer to them in code by their instance name, rather than the super’s name.
Here’s an example project to show you some basics with ContainerControl and PagePanel:
Container Control Example.xojo_binary_project
Hi Tim it fine, you gave a clear first answer. I didn’t make it clear possibly.
I only managed to get a ContainerControl by dragging a ContainerControl in the hierarchy of the main Window1 controls using the left side control column navigation display. Highlighting a ContainerControl obscures the main Window1.
In addition, i found if you use copy and paste on a ContainerControl it doesn’t create a ContainerControl but seperate controls within that window you dragged into. It not a ContainerControl.
From your help i managed to duplicate multiple controls in one go into another PagePanel but now as ContainerControls. Thanks.
If ContainerControls is at the top of the left display hierarchy above the main control Window it can be dragged into another control but if it at the bottom of the column then it can’t, nor can it be dragged up the column to a higher tree as it won’t scroll.
I think you need to read the documentation. You seem to be fighting the system.