end form in c# windows application code example Example: how to exit a program in c# Application.Exit();