From the course: Visual Basic Essential Training

Unlock this course with a free trial

Join today to access over 24,500 courses taught by industry experts.

Add click event handler code

Add click event handler code

- [Instructor] Before I write the code, let's talk about our controlled names. We use these names to get access to them in the code behind file. So earlier in the previous video, I changed the name of my ListBox. I called it ToDoList. The button could use a better name. So I've named that AddButton. Now you can change it here in the XML or you can go to the properties window and change it here at the top. There's a convention you see in a lot of UI and Microsoft tools where they use a number. So in this text block would be called TextBlock1, and this would be called text block, or TextBox, I should say, one, but that's not a very good name. I would suggest picking a more meaningful name. I'm going to go ahead and leave it at this. I've edited this to use the standard naming TextBox1, and I would also prefer to not have the lowercase t in here. So let's change that and go here and rename this to TextBlock1. And then let's take a look at my button. So that has the AddButton. So at this…

Contents