New to Xojo- first project. I am unintentionally abusing this coding effort.
The basic task is to create a runtime configurable UI for machine techs to configure equipment. The 1st phase code testing does the following:
Application has a TabPanel.
1st panel is static data always accessible. Currently, it has a single button to create new tab panels.
For each button press, a new tab is to be created and populated with a listbox (or grid view type object) to display data for the User to enter about the machine process.
The listbox is configured to known dimensions
The new tab panels are generated, but listbox isn’t created at runtime by the AddNewControl method (generates compiler faults). I’ve read blog articles and tested various approaches, but I am obviously abusing this code. Here’s one of the code snippets which shows the basic goal:
’ add a tab panel for a new cabinet/solenoid cfg
var tabPanelCurrentCount As Integer = tabPanel_cabinetCfg.PanelCount
var tabPanelNextIdx As Integer = tabPanelCurrentCount + 1
var tabPanelLastCreatedPanel As Integer = 0
tabPanelLastCreatedPanel = tabPanel_cabinetCfg.LastAddedPanelIndex
if tabPanelLastCreatedPanel <> 0 then
tabPanelLastCreatedPanel.AddControl(listBox_cabCfg)
Me.AddControl(listBox_cabCfg)
end if
I could use a hint or push in the right direction… Thanks
Learn about DesktopContainer, put your ListBox in one of those (plus whatever other controls you may want), and then you can dynamically add (replicate) any number of your custom container to your new tab panels.
Works well for me.
Admittedly it’s a bit of a learning curve, but a very powerful feature.
Yes, that crossed my mind. I thought that
tabPanelLastCreatedPanel.AddControl(listBox_cabCfg)
would attach it to the created panel. The compiler didn’t like that. Thanks!