Okay, a pitifal question, but how do I exit my program when it's running? Same as the ext button on the Windows API does, but I have a menu item that I want to close the program.
I know in VB it's just "End", what is it in C#?
Thanks.
Printable View
Okay, a pitifal question, but how do I exit my program when it's running? Same as the ext button on the Windows API does, but I have a menu item that I want to close the program.
I know in VB it's just "End", what is it in C#?
Thanks.
It definitely SHOULDN'T be End in VB. Using End is a terrible way to exit an app because it simply halts execution immediately with no cleanup whatsoever. In both VB.NET and C#, as well as any other .NET language, you can simply call Me.Close if the form is the startup form. Otherwise you should call Application.Exit.
There is no "End" in VB.NET, only in VB 6. Both VB.NET and C# use like what John posted.
Thanks guys, I have one problem, when I do the Me.Close or Application.Exit commands I get this error:
Code:Only assignment, call, increment, decrement, and new object expressions can be used as a statement
yer you have to type this: application.exit();
you need the two brackets after exit
:-)
Ah yes, that got it, thanks. :).