August 2003
Beginner
600 pages
12h 55m
English
After you obtain a reference to an object and assign it to a variable, you can manipulate the object using an object variable. You're going to do this now so follow these steps:
1. | Click the Form1.cs Design tab to view the Form Designer. | ||||||||||
2. | Add a button to the form by double-clicking the Button item in the toolbox. Set the button's properties as follows:
| ||||||||||
3. | Double-click the button to access its Click event, and enter the following code:
clsMyClass objMyObject = new clsMyClass(); MessageBox.Show(objMyObject.AddTwoNumbers(1,2).ToString()); |
The first statement creates a variable of type clsMyClass. (Declaring variables was discussed in ...
Read now
Unlock full access