From the course: Visual Basic Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Add click event handler code - Visual Basic Tutorial
From the course: Visual Basic Essential Training
Add click event handler code
- [Instructor] Because of the way Windows works you won't put the VB code in sub main. Instead WPF and the other desktop UI tools have the concept of event driven code. What does that mean? When the user interacts with the UI by clicking on the button, that raises an event. We create code blocks that are triggered by the event, so when the click event happens our click event code runs. When a text changed event happens a different bit of code runs. To work with these controls we need to know their name, so I'll select one of the controls and check out what it says down here in the XAML. The name of this is button. For the text box the name is text box. You can also see that over here. You want to guess what the name for the text block is? You got it, text block. Now you can change this to names that make more sense to your code and your application. For instance, I could call this the output the date button, so I can…
Contents
-
-
-
-
-
What applications can you create?2m 13s
-
(Locked)
Add additional projects to the solution2m 31s
-
(Locked)
Review the Visual Studio Project template code3m 33s
-
(Locked)
Choose a startup project3m 8s
-
(Locked)
Work with a Windows UI project3m 48s
-
(Locked)
Add click event handler code3m 13s
-
(Locked)
Add TextChanged event handler code2m 21s
-
-
-
-
-
-
-
-
-
-
-
-