chapter 6 oop: creating object- oriented programs programming in visual basic.net

46
Chapter 6 Chapter 6 OOP: Creating OOP: Creating Object-Oriented Object-Oriented Programs Programs Programming In Programming In Visual Basic .NET Visual Basic .NET

Upload: ryan-works

Post on 02-Apr-2015

240 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

Chapter 6Chapter 6OOP: Creating Object-OOP: Creating Object-

Oriented ProgramsOriented Programs

Programming InProgramming In

Visual Basic .NETVisual Basic .NET

Page 2: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 2

Object-Oriented (OO) ProgramObject-Oriented (OO) Program

• ObjectsObjects

– Consist of oneConsist of oneor more dataor more datavalues whichvalues whichdefine the statedefine the stateor propertiesor propertiesof the objectof the object

– Encapsulated byEncapsulated bya set of functions (methods) that can be applied to that a set of functions (methods) that can be applied to that objectobject

DataDataDataData

MethodMethod

MethodMethod Method

Method

MethodMethod

MessageMessage

ClassClass

Page 3: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 3

Object-Oriented (OO) ProgramObject-Oriented (OO) Program

• ClassClass

– Defines:Defines:

• Characteristics of the data contained by objects of Characteristics of the data contained by objects of the classthe class

• Functions that can be applied to the objects of the Functions that can be applied to the objects of the classclass

DataDataDataData

MethodMethod

MethodMethod Method

Method

MethodMethod

DataDataDataData

MethodMethod

MethodMethod Method

Method

MethodMethod

DataDataDataData

MethodMethod

MethodMethod Method

Method

MethodMethod

ClassClass

Page 4: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 4

"Cookie Analogy""Cookie Analogy"

• Class = Cookie cutterClass = Cookie cutter

• Instantiate = Making a cookie using the cookie cutterInstantiate = Making a cookie using the cookie cutter

• Instance = Newly made cookieInstance = Newly made cookie

• Properties of the Instance may have different valuesProperties of the Instance may have different values

– Icing property can be True or FalseIcing property can be True or False

– Flavor property could be Lemon or ChocolateFlavor property could be Lemon or ChocolateDataDataDataData

MethodMethod

MethodMethod Method

Method

MethodMethod

DataDataDataData

MethodMethod

MethodMethod Method

Method

MethodMethod

DataDataDataData

MethodMethod

MethodMethod Method

Method

MethodMethod

ClassClass

ObjectObject ObjectObject ObjectObject

Page 5: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 5

"Cookie Analogy" (continued)"Cookie Analogy" (continued)

• Methods = Eat, Bake, or CrumbleMethods = Eat, Bake, or Crumble

• Events = Cookie crumbling all by itself and informing youEvents = Cookie crumbling all by itself and informing you

Distinction between method and an event is somewhat fuzzy

Page 6: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 6

Object-Oriented Terminology Object-Oriented Terminology

• Encapsulation Encapsulation

• InheritanceInheritance

• PolymorphismPolymorphism

• Reusable ClassesReusable Classes

• Multitier ApplicationsMultitier Applications

Page 7: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 7

EncapsulationEncapsulation

• Combination of characteristics of an object along with its Combination of characteristics of an object along with its behavior in "one package"behavior in "one package"

• Cannot make object do anything it does not already Cannot make object do anything it does not already "know" how to do"know" how to do

• Cannot make up new properties, methods, or eventsCannot make up new properties, methods, or events

• Sometimes referred to as data hiding; an object can expose Sometimes referred to as data hiding; an object can expose only those data elements and procedures that it wishesonly those data elements and procedures that it wishes

Page 8: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 8

EncapsulationEncapsulation

DataDataDataData

MethodMethod

MethodMethod Method

Method

MethodMethod

MessageMessage

ClassClass

Page 9: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 9

InheritanceInheritance

• Ability to create a new class from an existing classAbility to create a new class from an existing class

– Original class is called Base Class, Superclass, or Original class is called Base Class, Superclass, or Parent ClassParent Class

– Inherited class is called Subclass, Derived Class, or Inherited class is called Subclass, Derived Class, or Child ClassChild Class

• For example, each form created is inherited from the For example, each form created is inherited from the existing Form classexisting Form class

• Purpose of inheritance is reusabilityPurpose of inheritance is reusability

Page 10: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 10

Inheritance (continued)Inheritance (continued)

• Examine first line of code for a form in the EditorExamine first line of code for a form in the Editor

Public Class Form1Inherits System.Windows.Forms.Form

Inherited Class: Subclass, Derived Class, Child Class

Original Class: Base Class, Superclass, Parent Class

Page 11: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 11

Inheritance ExampleInheritance Example

• Base ClassBase Class

– PersonPerson

• SubclassesSubclasses

– EmployeeEmployee

– CustomerCustomer

– StudentStudent

Person-Name-Address-Phone

Employee StudentCustomer

PropertiesProperties

Page 12: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 12

PolymorphismPolymorphism

• Methods having identical names but different Methods having identical names but different implementationsimplementations

• OverloadingOverloading

– Several argument lists for calling the methodSeveral argument lists for calling the method

– ExampleExample: MessageBox.Show method: MessageBox.Show method

• OverridingOverriding

– Refers to a class that has the same method name as its Refers to a class that has the same method name as its base classbase class

– Method in subclass takes precedenceMethod in subclass takes precedence

Page 13: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 13

ReusabilityReusability

• Big advantage of OOP over traditional programmingBig advantage of OOP over traditional programming

• New classes created can be used in multiple projectsNew classes created can be used in multiple projects

• Each object created from the class can have its own Each object created from the class can have its own propertiesproperties

Page 14: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 14

Multitier ApplicationsMultitier Applications

• Classes are used to create multitier applicationsClasses are used to create multitier applications

• Each of the functions of a multitier application can be Each of the functions of a multitier application can be coded in a separate component and stored and run on coded in a separate component and stored and run on different machinesdifferent machines

• Goal is to create components that can be combined and Goal is to create components that can be combined and replacedreplaced

Page 15: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 15

Three-tier ModelThree-tier Model

• Most popular implementationMost popular implementation

Presentation Tier Business Tier Data Tier

User InterfaceFormsControlsMenus

Business ObjectsValidationCalculationsBusiness LogicBusiness Rules

Data RetrievalData Storage

Page 16: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 16

Instantiating An ObjectInstantiating An Object

• Creating a new object based on a classCreating a new object based on a class

• Create an instance of the class by using the New keywordCreate an instance of the class by using the New keyword

• General FormGeneral Form

New className( )

Page 17: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 17

New Keyword ExamplesNew Keyword Examples

Dim arialFont As Font = New Font ("Arial", 12)messageLabel.Font = arialFont

ORmessageLabel.Font = New Font ("Arial", 12)

Page 18: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 18

Specifying a NamespaceSpecifying a Namespace

• In your projects, you have noticed the In your projects, you have noticed the Inherits clauseInherits clause when VB creates a new form classwhen VB creates a new form class

Public Class Form1Inherits System.Windows.Forms.Form

Name of the Class

Namespace

Page 19: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 19

Specifying a Namespace Specifying a Namespace (continued)(continued)

• Entire namespace is not needed for any classes in the Entire namespace is not needed for any classes in the namespaces that are automatically included in a Windows namespaces that are automatically included in a Windows Forms project which includeForms project which include– SystemSystem– System.Windows.FormsSystem.Windows.Forms– System.DrawingSystem.Drawing

• When referring to a class in a different namespaceWhen referring to a class in a different namespace– Write out the entire namespace orWrite out the entire namespace or– Add an Imports statement at the top of the code to Add an Imports statement at the top of the code to

specify the namespacespecify the namespace

Page 20: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 20

Designing Your Own ClassDesigning Your Own Class

• Analyze characteristics needed by new objectsAnalyze characteristics needed by new objects

– Characteristics or properties are defined as variablesCharacteristics or properties are defined as variables

– Define the properties as variables in the class moduleDefine the properties as variables in the class module

• Analyze behaviors needed by new objectsAnalyze behaviors needed by new objects

– Behaviors are methodsBehaviors are methods

– Define the methods as sub procedures or functionsDefine the methods as sub procedures or functions

Page 21: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 21

Creating Properties in a ClassCreating Properties in a Class

• Define variables inside the Class module by declaring Define variables inside the Class module by declaring them as Privatethem as Private

• Do not make Public, that would violate encapsulation Do not make Public, that would violate encapsulation (each object should be in charge of its own data)(each object should be in charge of its own data)

Page 22: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 22

Property ProceduresProperty Procedures

• Properties in a class are accessed with accessor methods in Properties in a class are accessed with accessor methods in a property procedurea property procedure

• Name used for property procedure is the name of the Name used for property procedure is the name of the property seen by the outside worldproperty seen by the outside world

• Set StatementSet Statement– Uses Value keyword to refer to incoming value for Uses Value keyword to refer to incoming value for

propertyproperty– Assigns a value to the propertyAssigns a value to the property

• Get StatementGet Statement– Retrieves a property valueRetrieves a property value– Must assign a return value to the procedure nameMust assign a return value to the procedure name

Page 23: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 23

Property Procedure General FormProperty Procedure General Form

Private ClassVariable As DataType[Public] Property PropertyName( ) As DataType

GetReturn ClassVariable [PropertyName = ClassVariable]

End Get

Set (ByVal Value As DataType)[statements, such As validation]ClassVariable = Value

End SetEnd Property

Page 24: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 24

Read-Only PropertiesRead-Only Properties

• In some instances a value for a property should only be In some instances a value for a property should only be retrieved by an object and not changedretrieved by an object and not changed

– Create a read-only property by using the ReadOnly Create a read-only property by using the ReadOnly modifiermodifier

– Write only the Get portion of the property procedureWrite only the Get portion of the property procedure

[Public] ReadOnly Property PropertyName( ) As DataType

Page 25: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 25

Write-Only PropertiesWrite-Only Properties

• At times a property can be assigned by an object but not At times a property can be assigned by an object but not retrievedretrieved

– Create a property block that contains only a Create a property block that contains only a Set Set to to create a write-only propertycreate a write-only property

[Public] WriteOnly Property PropertyName( ) As DataType

Page 26: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 26

Class MethodsClass Methods

• Create methods by coding public procedures within a classCreate methods by coding public procedures within a class

• Methods declared with the Private keyword are available Methods declared with the Private keyword are available only within the classonly within the class

• Methods declared with the Public keyword are available to Methods declared with the Public keyword are available to external objectsexternal objects

Page 27: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 27

Constructors and DestructorsConstructors and Destructors

• ConstructorConstructor

– Method that automatically executes when an object is Method that automatically executes when an object is instantiatedinstantiated

– Constructor must be public and is named NewConstructor must be public and is named New

• DestructorDestructor

– Method that automatically executes when an object is Method that automatically executes when an object is destroyeddestroyed

Page 28: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 28

Overloading MethodsOverloading Methods

• Overloading means that two methods have the same name Overloading means that two methods have the same name but a different list of arguments (the signature)but a different list of arguments (the signature)

• Create by giving the same name to multiple procedures in Create by giving the same name to multiple procedures in your class module, each with a different argument listyour class module, each with a different argument list

Page 29: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 29

Parameterized ConstructorParameterized Constructor

• Constructor that requires argumentsConstructor that requires arguments

• Allows arguments to be passed when creating an objectAllows arguments to be passed when creating an object

Page 30: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 30

Create a New ClassCreate a New Class

• Project, Add ClassProject, Add Class

• In Add New Item dialog box, chooseIn Add New Item dialog box, chooseClassClass

• Name the ClassName the Class

• Define the Class propertiesDefine the Class properties

• To allow access from outside the class, add property To allow access from outside the class, add property proceduresprocedures

• Code the methodsCode the methods

Page 31: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 31

Creating a New ObjectCreating a New Object Using a Class Using a Class

• Similar to creating a new tool for the toolbox but not yet Similar to creating a new tool for the toolbox but not yet creating an instance of the classcreating an instance of the class

• Declare a variable for the new objectDeclare a variable for the new object

• Then, instantiate the object using the New keywordThen, instantiate the object using the New keyword

Private aBookSale As BookSaleaBookSale = New BookSale( )OrDim aBookSale As New Booksale( )

Page 32: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 32

Creating a New ObjectCreating a New Object Using a Class (continued) Using a Class (continued)

• If object variable is needed in multiple procedures, delcare If object variable is needed in multiple procedures, delcare the object at class levelthe object at class level

• Instantiate the objectInstantiate the object

– Only when(if) it is neededOnly when(if) it is needed

– Inside a Try/Catch block for error handling (Try/Catch Inside a Try/Catch block for error handling (Try/Catch block must be inside a procedure)block must be inside a procedure)

• Pass values for the arguments at instantiation when using a Pass values for the arguments at instantiation when using a parameterized constructorparameterized constructor

Page 33: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 33

Instance Variables versus Shared Instance Variables versus Shared VariablesVariables

• Instance variables or propertiesInstance variables or properties

– Separate memory location for each instance of the Separate memory location for each instance of the objectobject

• Shared variables or propertiesShared variables or properties

– Single variable that is available for ALL objects of a Single variable that is available for ALL objects of a classclass

– Can be accessed without instantiating an object of the Can be accessed without instantiating an object of the classclass

– Use the Shared keyword to createUse the Shared keyword to create

Shared Methods can also be created

Page 34: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 34

Garbage CollectionGarbage Collection

• Feature of .NET Common Language Runtime (CLR) that Feature of .NET Common Language Runtime (CLR) that cleans up unused componentscleans up unused components

• Periodically checks for unreferenced objects and releases Periodically checks for unreferenced objects and releases all memory and system resources used by the objectsall memory and system resources used by the objects

• Microsoft recommends depending on Garbage Collection Microsoft recommends depending on Garbage Collection rather than Finalize proceduresrather than Finalize procedures

Page 35: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 35

InheritanceInheritance

• New class canNew class can

– Be based on another class (base class)Be based on another class (base class)

– Inherit the properties and methods (but not Inherit the properties and methods (but not constructors) of the base class, which can beconstructors) of the base class, which can be

• One of the VB existing classesOne of the VB existing classes

• Your own classYour own class

• Use the Inherits statement following the class header and Use the Inherits statement following the class header and prior to any commentsprior to any comments

Page 36: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 36

Overriding MethodsOverriding Methods

• Methods with the same name and the same argument list Methods with the same name and the same argument list as the base classas the base class

• Derived class (subclass) will use the new method rather Derived class (subclass) will use the new method rather than the method in the base classthan the method in the base class

• To override a methodTo override a method

– Declare the original method with the Overridable Declare the original method with the Overridable keyword keyword

– Declare the new method with the Overrides keywordDeclare the new method with the Overrides keyword

Page 37: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 37

Creating a Base Class Strictly for Creating a Base Class Strictly for InheritanceInheritance

• Classes can be created strictly for inheritance by two or Classes can be created strictly for inheritance by two or more similar classes and are never instantiatedmore similar classes and are never instantiated

• For a base class that you intend to inherit from, include the For a base class that you intend to inherit from, include the MustInherit modifier on the class declarationMustInherit modifier on the class declaration

• In each base class method that must be overridden, include In each base class method that must be overridden, include the MustOverride modifier and no code in the base class the MustOverride modifier and no code in the base class methodmethod

Page 38: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 38

Inheriting Form ClassesInheriting Form Classes

• Many projects require several formsMany projects require several forms

• Create a base form and inherit the visual interface to new Create a base form and inherit the visual interface to new formsforms

• Base form inherits from System.Windows.Forms.FormBase form inherits from System.Windows.Forms.Form

• New form inherits from Base formNew form inherits from Base form

Page 39: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 39

Creating Inherited Form ClassCreating Inherited Form Class

• Project menu, Add Windows FormProject menu, Add Windows Form

• Modify the Inherits Statement to inherit from base form Modify the Inherits Statement to inherit from base form using project name as the namespaceusing project name as the namespace

• OROR

• Project menu, Add Inherited FormProject menu, Add Inherited Form

• In dialog select name of base formIn dialog select name of base form

Page 40: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 40

Coding for Events of an Inherited Coding for Events of an Inherited ClassClass

• Copy procedure from base class into derived class and Copy procedure from base class into derived class and make modificationsmake modifications

• An alternate way is to use the inherited event handler in An alternate way is to use the inherited event handler in the derived classthe derived class

Page 41: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 41

Managing Multiclass ProjectsManaging Multiclass Projects

• VB projects are automatically assigned a namespace which VB projects are automatically assigned a namespace which defaults to the name of the projectdefaults to the name of the project

• Add an existing class to a project by copying the file into Add an existing class to a project by copying the file into the project folder and then adding the file to the projectthe project folder and then adding the file to the project

– Project/Add Existing ItemProject/Add Existing Item

Page 42: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 42

Displaying Values on a Different Displaying Values on a Different FormForm

• Refer to controls on another form by using the identifier Refer to controls on another form by using the identifier for the form instancefor the form instance

• General SyntaxGeneral Syntax

• ExampleExample FormInstance.ControlName.Property

Dim aSummaryForm As New summaryForm( )aSummaryForm.SalesLabelTotal.Text = aBookSale.SalesTotal.ToString("C")

Page 43: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 43

Using the Object BrowserUsing the Object Browser

• Use it to view the names, properties, methods, events and Use it to view the names, properties, methods, events and constants of VB objects, your own objects, and objects constants of VB objects, your own objects, and objects available from other applicationsavailable from other applications

• To DisplayTo Display

– Click on Tab in Editor WindowClick on Tab in Editor Window

– Object Browser toolbar buttonObject Browser toolbar button

Page 44: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 44

Object BrowserObject BrowserObjectslist

Browselist

FindSymbol

Namespaceicons

Memberslist

Classicon

Constantsicon

Method icon

Property icon

Description Pane

Page 45: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 45

Examining VB ClassesExamining VB Classes

Members ofSystem.Windows.Forms.MessageBox Class

Page 46: Chapter 6 OOP: Creating Object- Oriented Programs Programming In Visual Basic.NET

© 2005 by The McGraw-Hill Companies, Inc. All rights reserved.6- 46

Examining VB Classes (continued)Examining VB Classes (continued)

Display theMessageBoxButtons Constants