Listbox Instantiation via Code Issue

I have an issue where the IDE chokes on my following code to instantiate a new listbox. My "ICPDynamicEventViewerListbox is a class with it’s super set to listbox. I do this all of the time with containers, but unlike a container I can’t embed this control within the window… I can’t even debug it since after I click on the array and it’s element the IDE blows up ()

  // Instantiate Via Code the ICP Log Listbox Controls
  EventViewerWindow.ICP_DynamicEventViewer_Listbox = New ICPDynamicEventViewerListbox
  EventViewerWindow.ICP_DynamicEventViewer_Listbox.Left = 157
  EventViewerWindow.ICP_DynamicEventViewer_Listbox.Top = 48
  EventViewerWindow.ICP_DynamicEventViewer_Listbox.Width = 1242
  EventViewerWindow.ICP_DynamicEventViewer_Listbox.Height = 555
  EventViewerWindow.ICP_DynamicEventViewer_Listbox.LockTop = True
  EventViewerWindow.ICP_DynamicEventViewer_Listbox.Lockbottom = True
  EventViewerWindow.ICP_DynamicEventViewer_Listbox.Lockleft = True
  EventViewerWindow.ICP_DynamicEventViewer_Listbox.Lockright = True
  EventViewerWindow.ICP_DynamicEventViewer_Listbox.Border  = true
  EventViewerWindow.ICP_DynamicEventViewer_Listbox.ColumnCount = 1
  EventViewerWindow.ICP_DynamicEventViewer_Listbox.ColumnsResizable = True
  EventViewerWindow.ICP_DynamicEventViewer_Listbox.Enabled= true
  EventViewerWindow.ICP_DynamicEventViewer_Listbox.AutoHideScrollbars = true
  EventViewerWindow.ICP_DynamicEventViewer_Listbox.GridLinesHorizontal = 3
  EventViewerWindow.ICP_DynamicEventViewer_Listbox.GridLinesVertical = 3
  
  EventViewerWindow.ICP_DynamicEventViewer_Listbox.Visible = True
  
  EventViewerWindow.ICP_DynamicEventViewer_ListboxArray.Append EventViewerWindow.ICP_DynamicEventViewer_Listbox

Can I not instantiate a listbox class from code?

Thanks for all the help!

I have a feeling someone is going to tell me that I have to put this listbox into a container and instantiate that container… :slight_smile:

https://forum.xojo.com/9445-dynamic-listbox/0

This answers it… :wink:

But the IDE really shouldn’t crash if you do something wonky. However, the chance to get something like that fixed before 2020 is rather low…