Hi,
How can I make a windows form create a console window
I can create a console application and add windows forms. This worked well. However I had to change the application type to a "Windows application" in order to get the splashscreen functionality. Now I havnt got a console window...
Thanks
John

How to Create a Console Window from a VB form?
Sam4u2e
You can redirect the input/output streams for a console to a textbox.
Check out this thread and see if the code and comments therein help: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=443683&SiteID=1
Bear23
A bit of a question.
If your application is going to open up a console window just to dump information to which you are going to pick up and display in a textbox. Why not just cut the console window out and dump you applications info into the textbox.
Some of what Visual Studio is doing is displaying console output because it is running a command line application. Example of this is VBC.exe which is the VBC command line compiler. You VS project is ultimately being compiled using a command line compiler - so this window is showing you the actual process that is being carried out to compile the application.
The functionality is the whats being shown in the window. Think of it as a Process.start or shell method being called on the VBC.exe command line compiler.
If you want to have a windows application which will run a console application then you can simply use either the system.diagnostic,process.start method or the shell command to execute the 2nd application which would be a console application.
But if its providing additional information for the currently running application - this seems a little strange.
techguy52
Create a console application
Add a reference to system.windows.forms
Create a windows form to act as a splash screen
Code up you application to call the splash screen form
Example
Module Module1
Sub Main()
Dim x As New SplashScreen1
x.Show()
Threading.Thread.Sleep(2000)
x.Close()
Dim abc As Integer = 1
Dim a = Console.ReadLine
End Sub
End Module
What you wont get is the default splashscreen functionality as the windows forms application framework is not available to console applications so you cant simple set the property to indicate the splash screen - but a console application can display a form with the appropriate references. So it is possible.
The code above is not meant as definitive code, merely to show a concept of calling a windows form for a splash screen from a console application.
Andrew Butenko
Many thanks for your post, it explains why I dont get the option for a splashscreen in a console app.
However, what I'm really looking for is the ability to have a button on a form that would open a console up (and close it if required) where the app would dump more detailed debugging information. My app outputs debug info to the console whilst it's runnig. In visual studio the output is dumped to the immediate window if I havnt got a console up, but of course the Immediate window isnt available when the app is running outside Visual studio.
Your solution is very useful but it means the console would always be up, if you see what I mean. I want to hide it until it's needed.
Alternatively, is there a way of redirecting console output to a text box in a windows form
LORD ORION
Hi,
Thanks for your reply. Sorry about the delay. THe main reason for wanting to setup output to a console window is that I already have a lot of debugging output using console.writeline. If I could easily setup another console window then I can get this debugging output without having to write anything extra.
Many thanks
John
darngar
changing the Application type to Console Window in a WinForms app will start up not only your WinForm app but also along with it the Console Window so you can display output to it or accepts inputs from it etc....Changing it back to Windows Application does not show the Console Window when your app starts up.
you cannot just "show" a console window I believe.