Visual Basic uses partial-class definitions to separate generated code from user-authored code in separate source files. For example, the Windows Form Designer defines partial classes for controls such as Form. You should not modify the generated code in these controls.
All the rules for class and structure creation, such as those for modifier usage and inheritance, apply when creating a partial class or structure.
Best Practices
Under normal circumstances, you should not split the development of a single class or structure across two or more declarations. Therefore, in most cases you do not need the Partial keyword.
For readability, every partial declaration of a class or structure should include the Partial keyword. The compiler allows at most one partial declaration to omit the keyword; if two or more omit it the compiler signals an error.
Behavior
Union of Declarations. The compiler treats the class or structure as the union of all its partial declarations. Every modifier from every partial definition applies to the entire class or structure, and every member from every partial definition is available to the entire class or structure.
Type Promotion Not Allowed For Partial Types in Modules. If a partial definition is inside a module, type promotion of that class or structure is automatically defeated. In such a case, a set of partial definitions can cause unexpected results and even compiler errors. For more information, see Type Promotion.
The compiler merges partial definitions only when their fully qualified paths are identical.
The Partial keyword can be used in these contexts:
Class Statement
Structure Statement