if so, what is the code? ( i am using vb 2010 express)
(and how do you show it)
Since a Windows form is a GUI construct, that doesn't really make sense. I suppose you could send the output of a form to a console app, but not put the form in it.
...
I'm not really sure what you mean by "enclose", but if you are asking if you can launch a form from a VB console application, then the answer is yes.
First, add a form to your console app. Then create a new instance of it and call ShowDialog (or just Show, if you want).
Simple console app that launches a form:
Sub Main()
Dim f As New Form1
Dim ans As String
Console.WriteLine("Would you like to see a form?")
ans = Console.ReadLine()
If (ans.ToLower = "yes") Then
f.ShowDialog()
End If
End Sub
No you can not.
Copyright © 2024 Q2A.ES - All rights reserved.
Answers & Comments
Verified answer
Since a Windows form is a GUI construct, that doesn't really make sense. I suppose you could send the output of a form to a console app, but not put the form in it.
...
I'm not really sure what you mean by "enclose", but if you are asking if you can launch a form from a VB console application, then the answer is yes.
First, add a form to your console app. Then create a new instance of it and call ShowDialog (or just Show, if you want).
Simple console app that launches a form:
Sub Main()
Dim f As New Form1
Dim ans As String
Console.WriteLine("Would you like to see a form?")
ans = Console.ReadLine()
If (ans.ToLower = "yes") Then
f.ShowDialog()
End If
End Sub
No you can not.