Spread Windows Forms 10.0 Product Documentation
MaskPatternFieldInfo Constructor(String,Int32,Int32)
Example 


A System.String value indicates the pattern.
An System.Int32 value indicates the minimum length.
An System.Int32 value indicates the maximum length.
Initializes a new instance of the MaskPatternFieldInfo class.
Syntax
'Declaration
 
Public Function New( _
   ByVal pattern As String, _
   ByVal minLength As Integer, _
   ByVal maxLength As Integer _
)
'Usage
 
Dim pattern As String
Dim minLength As Integer
Dim maxLength As Integer
 
Dim instance As New MaskPatternFieldInfo(pattern, minLength, maxLength)
public MaskPatternFieldInfo( 
   string pattern,
   int minLength,
   int maxLength
)

Parameters

pattern
A System.String value indicates the pattern.
minLength
An System.Int32 value indicates the minimum length.
maxLength
An System.Int32 value indicates the maximum length.
Example
This example creates a GcMask cell.
GrapeCity.Win.Spread.InputMan.CellType.GcMaskCellType gcMask = new GrapeCity.Win.Spread.InputMan.CellType.GcMaskCellType();

GrapeCity.Win.Spread.InputMan.CellType.Fields.MaskPatternFieldInfo mpf = new GrapeCity.Win.Spread.InputMan.CellType.Fields.MaskPatternFieldInfo("\\D{3}", 3, 3);
mpf.AutoConvert = true;
mpf.BackColor = Color.Beige;
mpf.ForeColor = Color.DarkOliveGreen;
mpf.Font = SystemFonts.DefaultFont;
mpf.Name = "MaskPatternFieldInfo";
mpf.Padding = new System.Windows.Forms.Padding(3);

GrapeCity.Win.Spread.InputMan.CellType.Fields.MaskLiteralFieldInfo mlf = new GrapeCity.Win.Spread.InputMan.CellType.Fields.MaskLiteralFieldInfo("-");
mlf.BackColor = Color.Aqua;
mlf.ForeColor = Color.Black;
mlf.Margin = new System.Windows.Forms.Padding(4);
mlf.Name = "MaskLiteralFieldInfo";

GrapeCity.Win.Spread.InputMan.CellType.Fields.MaskPatternFieldInfo mlf2 = new GrapeCity.Win.Spread.InputMan.CellType.Fields.MaskPatternFieldInfo("\\D{4}", 4, 4);
mlf2.BackColor = Color.Aqua;
mlf2.ForeColor = Color.Black;
mlf2.Margin = new System.Windows.Forms.Padding(4);
mlf2.Name = "MaskLiteralFieldInfo2";

gcMask.Fields.AddRange(new GrapeCity.Win.Spread.InputMan.CellType.Fields.MaskFieldInfo[] { mpf, mlf, mlf2});
gcMask.PaintByControl = true;
gcMask.PromptChar = '#';
gcMask.RecommendedValue = "1234567";
gcMask.ShowRecommendedValue = true;

fpSpread1.ActiveSheet.Cells[0, 0].CellType = gcMask;
Dim gcMask As New GrapeCity.Win.Spread.InputMan.CellType.GcMaskCellType()

Dim mpf As New GrapeCity.Win.Spread.InputMan.CellType.Fields.MaskPatternFieldInfo("\D{3}", 3, 3)
mpf.AutoConvert = True
mpf.BackColor = Color.Beige
mpf.ForeColor = Color.DarkOliveGreen
mpf.Font = SystemFonts.DefaultFont
mpf.Name = "MaskPatternFieldInfo"
mpf.Padding = New System.Windows.Forms.Padding(3)

Dim mlf As New GrapeCity.Win.Spread.InputMan.CellType.Fields.MaskLiteralFieldInfo("-")
mlf.BackColor = Color.Aqua
mlf.ForeColor = Color.Black
mlf.Margin = New System.Windows.Forms.Padding(4)
mlf.Name = "MaskLiteralFieldInfo"


Dim mlf2 As New GrapeCity.Win.Spread.InputMan.CellType.Fields.MaskPatternFieldInfo("\D{4}", 4, 4)
mlf2.BackColor = Color.Aqua
mlf2.ForeColor = Color.Black
mlf2.Margin = New System.Windows.Forms.Padding(4)
mlf2.Name = "MaskLiteralFieldInfo2"

gcMask.Fields.AddRange(New GrapeCity.Win.Spread.InputMan.CellType.Fields.MaskFieldInfo() {mpf, mlf, mlf2})
gcMask.PaintByControl = True
gcMask.PromptChar = "#"
gcMask.RecommendedValue = "1234567"
gcMask.ShowRecommendedValue = True

FpSpread1.ActiveSheet.Cells(0, 0).CellType = gcMask
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

MaskPatternFieldInfo Class
MaskPatternFieldInfo Members
Overload List

 

 


Copyright © GrapeCity, inc. All rights reserved.