Window Instantiation Experiment Question(s)

Hello all. I have a dynamic content solution I am working towards that goes like this in it’s static Configuration.

  1. Main Window --> Listbox (row0 “TEST1”, Row1 “Test2”)

  2. Double Click on any Row --> Shows LiveWindow that has a Canvas

  3. TimerRuns on LiveWindow pulling info building Container Controls onto the LiveWindow Canvas

  4. Works great but I need to add Dynamic capabilities.

ie. WHen I double click on Row0 “test1” I should get only the content from test1 etc. for others. I have that working, however where I am failing is in the dynamic creation of the LiveWindow, its canvas.

If I have a LiveWindow already created with its “stuff” on it… Then I do a DIm NewLiveWin as New LiveWindow will I basically subclass all controls/methods etc. that were on LiveWindow originally?

Thanks and sorry for the question “squishiness” :slight_smile:

Thanks

Also How do I identify each individually newly created window so I can reference them in code? Thank you :wink:

You can create an array of livewindow with Dim NewLiveWin() As LiveWIndow. To create a new instance NewLiveWin.append New LiveWindow. Using the index of the NewLiveWin you can access the controls as per normal.

You don’t create a subclass it’s an instance.

If I were to do this I’d also set the celltag of column 0 to -1 on creation and when a new livewindow is created pop it index there that way you’ll know if the live window is already instantiated & can reuse it. Of course you’ll need to reset the celltag when the live window gets closed.

HTH

Wayne

Ah thanks Wayne! An Array of Windows :slight_smile: I never would have thought of that :slight_smile:

Thanks again! I will try that!

Wayne so if they are separate instances and lets say I have a timer on the original window that we instantiated off of… Will all of the new Windows i create have a separate copy of that timer running? (i hope:) )

Yes. Each newly instantiated window will have all the attributes (cointrols, properties, methods etc.) of the original.

Don’t forget to turn off implicit instance on the original.

Also you can add a constructor to the NewWindow and use that to pass property info e.g. the listindex of the listbox.

Much appreciated Wayne!

Thanks again Wayne I got it working nicely!!

Check out this OOP line of code :slight_smile: Nested Two Arrays Deep :slight_smile:

PercentageValue = ICP_Socket_Management.EVIP_Active_SocketCount_Array(T).EVIPStatusUpdateArray(i).Status_Percentage

:slight_smile: