Add Controls To Interface

Is it possible to add controls to an interface of type ContainerControl or Window? What is the quickest and most convenient way of having a subclassing window, where the superclass can access the controls that have been added using the layout editor?


You cannot inherit ui

Thanks. Do I have to assign UI to variables declared by the superclass then?

You can’t put controls on the super and then subclass it and refer to those controls

What should I do then? :\

No idea as I have no idea what you’re trying to do

  pComparision.BlockBase = CodeFrame.tag
  if DocFile.VariableScope = 0 then
    ScopeSelector.Items(0).Selected = true
    ScopeSelector.Items(1).Selected = true
  end if
  if BlockBase(CodeFrame.tag).MathVariable1 <> nil then
    txtIfThis.Text = BlockIfThen(CodeFrame.tag)
  end if
  if BlockBase(CodeFrame.tag).MathVariable2 <> nil then
    txtThis.Text = BlockIfThen(CodeFrame.tag)
  end if
  select case BlockBase(CodeFrame.tag).CustomMessage
  case "="
    pComparision.ListIndex = 0
  case ">"
    pComparision.ListIndex = 1
  case "<"
    pComparision.ListIndex = 2
  case "<>"
    pComparision.ListIndex = 3
  end select

I need all of this code happen on multiple ContainerControls, thanks.

Still have no idea what you’re trying to do. Spraying random code into a post isn’t very helpful. YOU know what you intend, but the code doesn’t help any of the rest of us understand what you intend. Please try to describe the problem you’re trying to solve. Thanks.

I am attempting to interact with UI with the same code across different container controls.


It sounds as if you’d want to create a new ContainerControl subclass. Put your code into this subclass. Then, in the IDE, you can drag & drop instances of this CC subclass on the window. (Or, you could instantiate new instances in code and embed them).

If the CC needs to talk to the containing window, use new Events defined in the CC.

This basically works quite similarly to how a custom Control subclass works.