[RESOLVED] In console applications, can't use Messagebox class why???
I can't use Messagebox class in console app's.
why so?
nath
Re: In console applications, can't use Messagebox class why???
MessageBox is a class inside of System.Windows.Forms. Since console apps don't have this referenced in the template, you need to do it manually in order to use them.
---Sorry for deleting. I just wanted to test it and make sure there wasn't something I missed. :P
Re: In console applications, can't use Messagebox class why???
You shouldn't be using MessageBoxes in a console app. Console apps don't have a GUI and the MessageBox class is a GUI element.
Re: In console applications, can't use Messagebox class why???
Re: In console applications, can't use Messagebox class why???
If this is resolved, you can help other forums members by please pulling down the Thread Tools menu and click the Mark Thread Resolved button. That will let everyone know that you have your answer.
Thank you. :)
Re: In console applications, can't use Messagebox class why???
Quote:
Originally Posted by jmcilhinney
You shouldn't be using MessageBoxes in a console app.
Says who? :p
Re: [RESOLVED] In console applications, can't use Messagebox class why???
The common-sense fairy, thats who :D
Re: In console applications, can't use Messagebox class why???
Quote:
Originally Posted by umilmi81
Says who? :p
The whole point of a console app is that it uses the console to interact with the user. What's wrong with Console.WriteLine to give the user a message? Also, what happens if someone tries to automate your console app by redirecting the standard streams? How's that going to handle a MessageBox?
Re: [RESOLVED] In console applications, can't use Messagebox class why???
If u want to use the messagebox in console app. U can add referrence the System.Windows.Forms.dll.
Re: [RESOLVED] In console applications, can't use Messagebox class why???
Quote:
Originally Posted by popskie
If u want to use the messagebox in console app. U can add referrence the System.Windows.Forms.dll.
wonderful site.
thanks
nath