You may have noticed that when the Code Editor opened, it already contained some code that looked like this:
Private Sub Button1_Click(ByVal sender As System.Object...
|
End Sub
This code is an event handler, also called a Sub procedure. Any code inside this procedure (between Sub and End Sub) runs every time that the button is clicked. You may also have noticed that the pointer was located inside the event procedure, so all that you had to do was type the code.
The code that you typed (WebBrowser1.Navigate(TextBox1.Text)) tells the program to take the text that was typed into TextBox1 and pass it as an argument to the Navigate method of the WebBrowser control (named WebBrowser1). To learn more about properties, methods, and events, see Closer Look: Understanding Properties, Methods, and Events
If you don't understand the code, don't worry—you will learn much more about how to write code in following lessons.
Next Steps