Step 3 of 4: Adding Code to the Application

In the previous steps you set up the application's user interface and added controls to your application. In this step you'll add code to your application to finalize it.

Complete the following steps:

1.   Return to the Design view of the form.

2.   Select Button1 on the form, navigate to the Properties window, click the lightning bolt Events icon to view events, and click the space next to the Click item to create a Button1_Click event handler and switch to Code view.

3.   Return to Design view and repeat the previous step with Button2 to create the Button2_Click event handler.

4.   In Code view, add the following import statement to the top of the page:

      Visual Basic

      C#

5.   Add the following code to the event handlers added earlier:

      Visual Basic

      C#

6.   Add the following code below the Button_Click event handlers:

      Visual Basic

      C#

This code specifies the size of the window and opens a new window.

In this step you completed adding code to your application. In the next step you'll run the application and observe run-time interactions.


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.