This documentation is archived and is not being maintained.

SubType Property (Visual Basic and C# ProjectItem Object)

Visual Studio .NET 2003

Returns or sets the SubType of the file.

[Visual Basic .NET]
Public Property SubType() As String
[Visual Basic 6]
Property Get SubType() As String
Property Let SubType( _
   ByVal NewValue As String _
HRESULT __stdcall get_ SubType(
   /* [out, retval] */ BSTR* retVal
HRESULT __stdcall put_ SubType(
   /* [in] */ BSTR NewValue
string SubType {get; set;}
[JScript .NET]
public function get SubType() : String
public function set SubType(
   NewValue : String


The new SubType string.

Return Value



The SubType is used to enable the View Designer and View Code buttons of the integrated development environment, show the correct icon in Solution Explorer, and launch the designer. This property is usually set by the compiler or language service when it parses the file and determines what type of file it is. If an item is added to a project through a wizard, the Add Item wizard sets the SubType.

Possible SubTypes include:

SubType StringDescription
"Form"A file containing a form, this supports visual design.
"Code" and "" (empty string)A code file.
"Component"A file containing a component. This SubType supports visual design.
"UserControl"A file containing a custom control. This SubType supports visual design.
"Designer"A file containing a generic designer. This SubType supports visual design.
"Preview"This type causes the project to open the item in the Web browser rather than an editor. For example, the Visual Basic 6 Migration Wizard sets this type on the .html report it generates so that double-clicking that report file brings up the browser rather than the HTML Editor.

The property is case-insensitive. This property is read-write, but the compiler may overwrite the value. For example, the SubType of a Windows.Forms.Form item may be changed through automation to "Code", but the compiler will reset the SubType to "Form".

See Also

Properties Property (General Extensibility) | ProjectItem Object

Applies To: Properties Property (Visual Basic and C# ProjectItem Object)