Join Anton Delsink for an in-depth discussion in this video Application.Run and .Exit, part of Object Oriented Programming with C#.
- [Narrator] Now that we have a really basic from,…with just a form object containing a button object…and its collection of controls…and some basic properties set on that button,…let's add another event handler to tie everything together.…On the form itself,…there is a form closed event.…Let's handle that event by adding an event handler.…And the event handler will just say,…application dot exit.…Why?…Remember at the bottom, line 26…we have application dot run,…which continues to accept input from the user…and send it through to our visual elements like the form.…
So now what I'm saying is,…when someone closes the form,…the form closed event will be raised,…our event handler will be invoked…and so the code we wrote for our event handler…on line 15, simply says application dot exit,…which causes the line 26 application dot run to exit.…So, let's click start,…see our application running,…click the button,…at which point it will call form dot close,…at which point the form will be closed,…the closed event will be raised…
- Abstract classes
- Processing text with StreamReader
- IEnumerable and yield return
- Windows Forms controls
- Windows Forms with and without the designer
- Adding, organizing, and testing forms
- Creating classes
Skill Level Intermediate
What you should know1m 10s
1. Theory vs. Practice
2. Examples from .NET
3. Examples from Windows UI
4. Examples from Board Games
5. Examples from the Web
Next steps1m 13s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.