IsSealed Property

Type.IsSealed Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets a value indicating whether the Type is declared sealed.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Public ReadOnly Property IsSealed As Boolean

Property Value

Type: System.Boolean
true if the Type is declared sealed; otherwise, false.

If the current Type represents a type parameter of a generic type, this property always returns true.

The following example creates an instance of a sealed class, checks for the IsSealed property, and displays the result.


Public NotInheritable Class Example

    Public Shared Sub Demo(ByVal outputBlock As System.Windows.Controls.TextBlock)

        Dim t As Type = GetType(Example)
        outputBlock.Text &= _
            String.Format("Is class {0} NotInheritable? {1}." & vbLf, _
            t.Name, t.IsSealed) 

    End Sub 
End Class 

' This example produces the following output:
'
'Is class Example NotInheritable? True.


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft