Previously, when I was using BevelButton, this code used to work:
Var newPBB As BevelButton newPBB = New PaperBevelButton //this is a control set of type BevelButton newPBB.Top = PaperBevelButton(index-1).Top + RowHeight
However, since changing everything to use the new API 2 DesktopUIControls, the equivalent code throws an IllegalCastException on line 2
Var newPBB As DesktopBevelButton newPBB = New PaperBevelButton //super of this control set is now DesktopBevelButton, throws exception newPBB.Top = PaperBevelButton(index-1).Top + RowHeight
The message of the exception is
MAK95Window.MAK95Window cannot be cast to PaperAnalysisListboxCanvasContainer.PaperAnalysisListboxCanvasContainer
PaperBevelButton is a child of PaperAnalysisListboxCanvasContainer which is a child of the window MAK95Window. So I am very confused as to what is happening…
Is it still possible to dynamically create new members of a control set at runtime in API 2? I read a recent blog post saying that there is a new way of adding controls, AddControl.
However, I can’t find any information on how to implement AddControl
New in 2021r3
Supported for all project types and targets.
Adds the control passed to the layout.
The LR on Desktop Control Sets seems to suggest that control sets should still work with the new DesktopUIControls.
Would anyone know the correct method to use?