Question Start form after application start

Bryce Gough

Active member
Joined
Mar 8, 2011
Messages
36
Location
Perth, Australia
Programming Experience
1-3
Hey Again,,

Sorry for all the console application questions but I'm new to working with the console, but I'm trying my hardest to find answers before I post a new thread.

I am dynamically creating forms in my console application and I am using Application.Run so that my forms are displayed without freezing.
Anyway, in my code I need to be able to show new forms after Application.Run has been executed..
Example:

Sub Main()
    Dim myForm as New Form
    myForm.Show()

    Application.Run()

    Dim secondForm as New Form
    secondForm.Show()
End Sub


However the secondForm is not displayed.
Now I realize that I can declare the secondForm before Application.Run, except here that won't do.
I need to be able to declare forms at any given time after the application has executed 'Run'.

If your wondering, it is because the user had the ability to create as many forms as they want (dynamically) and display them at any given time.

Now I don't need help storing the forms, or anything like that.. Just in making them display after Application.Run has been called.


Regards,
Bryce Gough
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,779
Location
Sydney, Australia
Programming Experience
10+
You have a Console application and in its Main method you are creating a form and calling Application.Run. What exactly do you think a Windows Forms application does? In its Main method, it creates a form and calls Application.Run. Just create a Windows Forms application and be done with it.

May I ask what exactly you're trying to achieve with all this? Why are you not already using a WinForms app?
 
Top Bottom