Join Anton Delsink for an in-depth discussion in this video Event handler for control, part of Object Oriented Programming with C#.
- Now that we have the graph of objects set through…associating objects through property assignments,…let's also add events.…For that, lets go to the Solution Explorer.…Double-click the form to show the designer…and select the button.…Press F4 or from the View menu.…Open the properties window.…And in this case,…click on the lightning bolt icon at the top.…We want to see the list of events…associated with the button.…Scroll to find the Click event…and double-click where it says click.…
You'll see the designer adds a method for you.…In this case, named button one underscore click.…I'll go to the form source code…and here we have the button one underscore click method,…which is our event handler.…And so, in our class…in the source code that we are editing ourselves,…this is where we will type our code.…However, there's the second form remember,…where the designer is generating code.…Let's go see what code was generated.…
Go to form one dot designer dot C S…and find your button again…and you will see there will be an extra line of code,…
- 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
C# Object-Oriented Programming Tips and Trickswith Jesse Freeman58m 39s 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.