NumberFormatInfo.IsReadOnly Property

 

Gets a value that indicates whether this NumberFormatInfo object is read-only.

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

Public ReadOnly Property IsReadOnly As Boolean

Property Value

Type: System.Boolean

true if the NumberFormatInfo is read-only; otherwise, false.

Attempting to perform an assignment to a property of a read-only NumberFormatInfo causes an InvalidOperationException.

You can call the Clone method to create a read/write NumberFormatInfo object from a read-only object, as the following example illustrates.

Imports System.Globalization

Module Example
   Public Sub Main()
      Dim nfi As NumberFormatInfo = NumberFormatInfo.CurrentInfo
      Console.WriteLine("Read-Only: {0}", nfi.IsReadOnly)
      Console.WriteLine()
      Dim nfiw As NumberFormatInfo = CType(nfi.Clone(), NumberFormatInfo)
      Console.WriteLine("Read-Only: {0}", nfiw.IsReadOnly)
   End Sub
End Module
' The example displays the following output:
'       Read-Only: True
'       
'       Read-Only: False

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: