user5473961
user5473961

Reputation:

How to dynamically create windows forms in a console application

I am working on my own programming language using Visual Basic 2010, Is there any way you can dynamically create windows forms in console application without any extra ad-on. If so.. Can you even keep it responsive?

Upvotes: 0

Views: 1446

Answers (1)

Jules SJ
Jules SJ

Reputation: 430

In a console application you'll have to add a reference to System.Windows.Forms. Then the basics are:

Sub Main()
    Dim NewForm As New System.Windows.Forms.Form
    NewForm.Text = "New Form"
    'Add any other settings or controls you want
    NewForm.ShowDialog()
End Sub

That will wait until the form is closed before exiting the application. Is that the kind of thing you had in mind?

Upvotes: 1

Related Questions