Exit statment in visual C#
-
Hi friends I have a problem. I have a login form in visual C# in which user must enter username amd password and then click login. If username or password is blank then one messegebox display that "Please enter username and password". After that i want to exit that sub. In Visual besic .Net there is command "EXIT SUB". In visual C# there is a static method call Application.exit but it is for close the whole application but i want only to exit the event and application should not be close. Please reply me as early as possible Thank you. (Hemant Uttam Mane) :)
-
Hi friends I have a problem. I have a login form in visual C# in which user must enter username amd password and then click login. If username or password is blank then one messegebox display that "Please enter username and password". After that i want to exit that sub. In Visual besic .Net there is command "EXIT SUB". In visual C# there is a static method call Application.exit but it is for close the whole application but i want only to exit the event and application should not be close. Please reply me as early as possible Thank you. (Hemant Uttam Mane) :)
Application.Exit() static method. See help Hi, AW
-
Hi friends I have a problem. I have a login form in visual C# in which user must enter username amd password and then click login. If username or password is blank then one messegebox display that "Please enter username and password". After that i want to exit that sub. In Visual besic .Net there is command "EXIT SUB". In visual C# there is a static method call Application.exit but it is for close the whole application but i want only to exit the event and application should not be close. Please reply me as early as possible Thank you. (Hemant Uttam Mane) :)
normally you can exit a sub (in C# it's called method) with return....like this:
public void Login()
{
//do some stuff here.....
return;
} -
Application.Exit() static method. See help Hi, AW
He said he didn't want to call that and exit the whole application.
Microsoft MVP, Visual C# My Articles
-
He said he didn't want to call that and exit the whole application.
Microsoft MVP, Visual C# My Articles
Sorry Hi, AW