MaskedTextProvider Constructors

Definition

Initializes a new instance of the MaskedTextProvider class.

Overloads

MaskedTextProvider(String)

Initializes a new instance of the MaskedTextProvider class using the specified mask.

MaskedTextProvider(String, Boolean)

Initializes a new instance of the MaskedTextProvider class using the specified mask and ASCII restriction value.

MaskedTextProvider(String, CultureInfo)

Initializes a new instance of the MaskedTextProvider class using the specified mask and culture.

MaskedTextProvider(String, Char, Boolean)

Initializes a new instance of the MaskedTextProvider class using the specified mask, password character, and prompt usage value.

MaskedTextProvider(String, CultureInfo, Boolean)

Initializes a new instance of the MaskedTextProvider class using the specified mask, culture, and ASCII restriction value.

MaskedTextProvider(String, CultureInfo, Char, Boolean)

Initializes a new instance of the MaskedTextProvider class using the specified mask, culture, password character, and prompt usage value.

MaskedTextProvider(String, CultureInfo, Boolean, Char, Char, Boolean)

Initializes a new instance of the MaskedTextProvider class using the specified mask, culture, prompt usage value, prompt character, password character, and ASCII restriction value.

MaskedTextProvider(String)

Source:
MaskedTextProvider.cs
Source:
MaskedTextProvider.cs
Source:
MaskedTextProvider.cs

Initializes a new instance of the MaskedTextProvider class using the specified mask.

public MaskedTextProvider (string mask);

Parameters

mask
String

A String that represents the input mask.

Remarks

Use of this constructor is exactly equivalent to the following call to the MaskedTextProvider.MaskedTextProvider(String, CultureInfo, Boolean, Char, Char, Boolean) constructor:

MaskedTextProvider(mask , null, true, '_', '\0', false)

See also

Applies to

.NET 9 dan versi lain
Produk Versi
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

MaskedTextProvider(String, Boolean)

Source:
MaskedTextProvider.cs
Source:
MaskedTextProvider.cs
Source:
MaskedTextProvider.cs

Initializes a new instance of the MaskedTextProvider class using the specified mask and ASCII restriction value.

public MaskedTextProvider (string mask, bool restrictToAscii);

Parameters

mask
String

A String that represents the input mask.

restrictToAscii
Boolean

true to restrict input to ASCII-compatible characters; otherwise false to allow the entire Unicode set.

Remarks

Use of this constructor is exactly equivalent to the following call to the MaskedTextProvider.MaskedTextProvider(String, CultureInfo, Boolean, Char, Char, Boolean) constructor:

MaskedTextProvider(mask , null, true, '_', '\0', restrictToASCII)

See also

Applies to

.NET 9 dan versi lain
Produk Versi
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

MaskedTextProvider(String, CultureInfo)

Source:
MaskedTextProvider.cs
Source:
MaskedTextProvider.cs
Source:
MaskedTextProvider.cs

Initializes a new instance of the MaskedTextProvider class using the specified mask and culture.

public MaskedTextProvider (string mask, System.Globalization.CultureInfo culture);
public MaskedTextProvider (string mask, System.Globalization.CultureInfo? culture);

Parameters

mask
String

A String that represents the input mask.

culture
CultureInfo

A CultureInfo that is used to set region-sensitive separator characters.

Remarks

Use of this constructor is exactly equivalent to the following call to the MaskedTextProvider.MaskedTextProvider(String, CultureInfo, Boolean, Char, Char, Boolean) constructor:

MaskedTextProvider(mask , culture, true, '_', '\0', false)

See also

Applies to

.NET 9 dan versi lain
Produk Versi
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

MaskedTextProvider(String, Char, Boolean)

Source:
MaskedTextProvider.cs
Source:
MaskedTextProvider.cs
Source:
MaskedTextProvider.cs

Initializes a new instance of the MaskedTextProvider class using the specified mask, password character, and prompt usage value.

public MaskedTextProvider (string mask, char passwordChar, bool allowPromptAsInput);

Parameters

mask
String

A String that represents the input mask.

passwordChar
Char

A Char that will be displayed for characters entered into a password string.

allowPromptAsInput
Boolean

true to allow the prompt character as input; otherwise false.

Remarks

Use of this constructor is exactly equivalent to the following call to the MaskedTextProvider.MaskedTextProvider(String, CultureInfo, Boolean, Char, Char, Boolean) constructor:

MaskedTextProvider(mask , null, allowPromptAsInput, '_', passwordChar, false)

See also

Applies to

.NET 9 dan versi lain
Produk Versi
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

MaskedTextProvider(String, CultureInfo, Boolean)

Source:
MaskedTextProvider.cs
Source:
MaskedTextProvider.cs
Source:
MaskedTextProvider.cs

Initializes a new instance of the MaskedTextProvider class using the specified mask, culture, and ASCII restriction value.

public MaskedTextProvider (string mask, System.Globalization.CultureInfo culture, bool restrictToAscii);
public MaskedTextProvider (string mask, System.Globalization.CultureInfo? culture, bool restrictToAscii);

Parameters

mask
String

A String that represents the input mask.

culture
CultureInfo

A CultureInfo that is used to set region-sensitive separator characters.

restrictToAscii
Boolean

true to restrict input to ASCII-compatible characters; otherwise false to allow the entire Unicode set.

Remarks

Use of this constructor is exactly equivalent to the following call to the MaskedTextProvider.MaskedTextProvider(String, CultureInfo, Boolean, Char, Char, Boolean) constructor:

MaskedTextProvider(mask , culture, true, '_', '\0', restrictToAscii)

See also

Applies to

.NET 9 dan versi lain
Produk Versi
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

MaskedTextProvider(String, CultureInfo, Char, Boolean)

Source:
MaskedTextProvider.cs
Source:
MaskedTextProvider.cs
Source:
MaskedTextProvider.cs

Initializes a new instance of the MaskedTextProvider class using the specified mask, culture, password character, and prompt usage value.

public MaskedTextProvider (string mask, System.Globalization.CultureInfo culture, char passwordChar, bool allowPromptAsInput);
public MaskedTextProvider (string mask, System.Globalization.CultureInfo? culture, char passwordChar, bool allowPromptAsInput);

Parameters

mask
String

A String that represents the input mask.

culture
CultureInfo

A CultureInfo that is used to set region-sensitive separator characters.

passwordChar
Char

A Char that will be displayed for characters entered into a password string.

allowPromptAsInput
Boolean

true to allow the prompt character as input; otherwise false.

Remarks

Use of this constructor is exactly equivalent to the following call to the MaskedTextProvider.MaskedTextProvider(String, CultureInfo, Boolean, Char, Char, Boolean) constructor:

MaskedTextProvider(mask , culture, allowPromptAsInput, '_', passwordChar, false)

See also

Applies to

.NET 9 dan versi lain
Produk Versi
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

MaskedTextProvider(String, CultureInfo, Boolean, Char, Char, Boolean)

Source:
MaskedTextProvider.cs
Source:
MaskedTextProvider.cs
Source:
MaskedTextProvider.cs

Initializes a new instance of the MaskedTextProvider class using the specified mask, culture, prompt usage value, prompt character, password character, and ASCII restriction value.

public MaskedTextProvider (string mask, System.Globalization.CultureInfo culture, bool allowPromptAsInput, char promptChar, char passwordChar, bool restrictToAscii);
public MaskedTextProvider (string mask, System.Globalization.CultureInfo? culture, bool allowPromptAsInput, char promptChar, char passwordChar, bool restrictToAscii);

Parameters

mask
String

A String that represents the input mask.

culture
CultureInfo

A CultureInfo that is used to set region-sensitive separator characters.

allowPromptAsInput
Boolean

A Boolean value that specifies whether the prompt character should be allowed as a valid input character.

promptChar
Char

A Char that will be displayed as a placeholder for user input.

passwordChar
Char

A Char that will be displayed for characters entered into a password string.

restrictToAscii
Boolean

true to restrict input to ASCII-compatible characters; otherwise false to allow the entire Unicode set.

Exceptions

The mask parameter is null or Empty.

-or-

The mask contains one or more non-printable characters.

Remarks

This constructor represents the most general overloaded form. The mask parameter must conform to the masking language defined by the MaskedTextProvider class, which is detailed in the MaskedTextBox.Mask property of the MaskedTextBox class.

Because neutral cultures cannot be queried for culture-specific information, the MaskedTextProvider constructor will use the GetCultures method to search for the first non-neutral culture to use to determine the proper separator characters.

See also

Applies to

.NET 9 dan versi lain
Produk Versi
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1