ControlSet Questions

  1. Is there a method for getting the length/size of a controlset? (how many controls are in the set)
  2. I want to create/add controls to my controlset during runtime but the example code doesn’t seem to work?
Var b As CardController // this is the control class
b = New CardControllerTemplate // create clone of the control on the layout // name of controlset
b.Left = MouseX-10 MouseY-30
b.Visible= True


Is CardControllerTemplate the name of a control that you placed on the window in the IDE? Or is it the name of the controlset?

CardController is the desktop container holding my custom control the template is the controlset yes.

You’re mixing containers and control sets? I’m confused.

Screenshot from 2023-03-23 21-32-49

Here is my project tree, I am new to xojo so if this is not how a custom control is made I am just trying to follow the documentation. Hope this explains how I made things so far, thanks for your time.

It looks like those are container controls. They are not compatible with control sets (ie., cannot be part of a control set). They are a good choice for creating a custom control, but unlike a control in a control set, it’s not enough to make it visible; you must embed it in the window.

Instead of

b.Visible = True

you should use

b.EmbedWithin(myWindow, x, y)

Hope that points you in the right direction. See

1 Like