Is it possible to load a window copy in a project in runtime?

My project does have a window which can display info. This info can contain different subjects, depending on the issue which calls the window. All info is standardized.

If the window is loaded because of an issue, can a second copy of this window be opened to contain info of another issue? Just in the same way you would load a containercontrol, but now a complete window with controls?

You can use code like this to display as many copies of a window you want:

Dim w As New MyWindow w.Show

Sure, that is called a new instance. You can load different content as well.

It is better to set the window to not have implicit instance.

Say you have a window1 with a TextArea1 on it. You can do

[code]Dim A as new Window1
A.Show // This shows the default text

Dim B as new Window1
B.TextArea1.Text = “Hello World, this is the second window”
B.Show[/code]

If you want to be able later to close or change the windows, make A and B Window1 properties of the App object, or of a module.

GREAT!!! thanks both!!! now i see where I went wrong…life can be such simple… :smiley:

I use this short code in my Close event to ensure that I clean up any open windows. I tend to sometimes minimize a window and forget to close it when I exit the app. This takes care of it for me.

// clean up any open windows For i As Integer = WindowCount - 1 DownTo 0 If Window(i) <> Nil Then Window(i).close Next