Partial Keyword


Partial Keyword

Syntax

     Partial   Class className        [statements]     End Class 

or:

     Partial Structure structureName        [statements]     End Structure 

These two syntax examples show only the minimal grammar for the Class and Structure statements, for demonstration of the Partial keyword only.

Description

The Partial keyword allows a single class or structure definition to be divided into multiple source code files. At least one of the class or structure portions must include the Partial keyword.

For syntax details on using the Partial keyword in context, see the Class...End Class Statement and the Structure...End Structure Statement entries elsewhere in this chapter.

Example

This example shows a class divided into two distinct files. The first source code file includes the following code.

     Public Class Customer        ...statements...     End Class 

The second source code file includes this code.

     Public Partial Class Customer        ...more statements...     End Class 

If desired, the Partial keyword could be added to both class component definitions.

Version Differences

The Partial keyword was introduced with Visual Basic 2005.

See Also

Class...End Class Statement, Structure...End Structure Statement




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net