Spread Windows Forms 10.0 Product Documentation
AlternateText Property (GcMaskCellType)
Example 


Gets a value that indicates alternate text settings.
Syntax
'Declaration
 
Public ReadOnly Property AlternateText As MaskAlternateTextInfo
'Usage
 
Dim instance As GcMaskCellType
Dim value As MaskAlternateTextInfo
 
value = instance.AlternateText
public MaskAlternateTextInfo AlternateText {get;}

Property Value

A MaskAlternateText value that indicates the alternate text settings.
Remarks
This property determines the text and text's color when the control's value is System.String.Empty.
Example
This example creates a GcMask cell.
GrapeCity.Win.Spread.InputMan.CellType.GcMaskCellType gcMask = new GrapeCity.Win.Spread.InputMan.CellType.GcMaskCellType();
gcMask.AcceptsArrowKeys = FarPoint.Win.SuperEdit.AcceptsArrowKeys.AllArrows;
gcMask.AcceptsCrLf = GrapeCity.Win.Spread.InputMan.CellType.CrLfMode.Filter;
gcMask.AcceptsTabChar = GrapeCity.Win.Spread.InputMan.CellType.TabCharMode.Filter;

gcMask.AlternateText.DisplayNull.ForeColor = Color.Red;
gcMask.AlternateText.DisplayNull.Text = "Display Null";
gcMask.AlternateText.Null.ForeColor = Color.Red;
gcMask.AlternateText.Null.Text = "Null value";

gcMask.AutoConvert = true;

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";
mlf.Font = SystemFonts.DefaultFont;

GrapeCity.Win.Spread.InputMan.CellType.Fields.MaskPatternFieldInfo mpf = new GrapeCity.Win.Spread.InputMan.CellType.Fields.MaskPatternFieldInfo("\\D{3}\\-\\D{4}", 7, 7);
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);
mpf.PasswordChar = '*';
mpf.PromptChar = '|';
mpf.Text = "MaskPatternFieldInfo_Text";
mpf.UseSystemPasswordChar = true;

GrapeCity.Win.Spread.InputMan.CellType.Fields.MaskLiteralFieldInfo mlf2 = new GrapeCity.Win.Spread.InputMan.CellType.Fields.MaskLiteralFieldInfo("}}: ");
mlf2.BackColor = Color.Aqua;
mlf2.ForeColor = Color.Black ;
mlf2.Margin = new System.Windows.Forms.Padding(4);
mlf2.Name = "MaskLiteralFieldInfo2";
mlf2.Font = SystemFonts.DefaultFont;

GrapeCity.Win.Spread.InputMan.CellType.Fields.MaskEnumerationFieldInfo mef = new GrapeCity.Win.Spread.InputMan.CellType.Fields.MaskEnumerationFieldInfo(new string[] { "item1", "item2", "item3", "item4" });
mef.AutoConvert = true;
mef.AutoDropDown = true;
mef.BackColor = Color.CadetBlue;
mef.DropDownEnabled = true;
mef.ForeColor = Color.Red;
mef.PromptChar = '|';
mef.SpinIncrement = 1;
mef.Text = "MaskEnumerationFieldInfo";
mef.Font = SystemFonts.DefaultFont;

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

gcMask.SideButtons.Add(new GrapeCity.Win.Spread.InputMan.CellType.SpinButtonInfo());

gcMask.Spin.AllowSpin = true;
gcMask.Spin.Increment = 1;
gcMask.Spin.SpinOnKeys = true;
gcMask.Spin.SpinOnWheel = true;
gcMask.Spin.Wrap = true;

gcMask.UseSpreadDropDownButtonRender = true;

fpSpread1.ActiveSheet.Cells[0, 0].CellType = gcMask;
Dim gcMask As New GrapeCity.Win.Spread.InputMan.CellType.GcMaskCellType()
gcMask.AcceptsArrowKeys = FarPoint.Win.SuperEdit.AcceptsArrowKeys.AllArrows
gcMask.AcceptsCrLf = GrapeCity.Win.Spread.InputMan.CellType.CrLfMode.Filter
gcMask.AcceptsTabChar = GrapeCity.Win.Spread.InputMan.CellType.TabCharMode.Filter

gcMask.AlternateText.DisplayNull.ForeColor = Color.Red
gcMask.AlternateText.DisplayNull.Text = "Display Null"
gcMask.AlternateText.Null.ForeColor = Color.Red
gcMask.AlternateText.Null.Text = "Null value"

gcMask.AutoConvert = True

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"
mlf.Font = SystemFonts.DefaultFont

Dim mpf As New GrapeCity.Win.Spread.InputMan.CellType.Fields.MaskPatternFieldInfo("\D{3}\-\D{4}", 7, 7)
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)
mpf.PasswordChar = "*"C
mpf.PromptChar = "|"C
mpf.Text = "MaskPatternFieldInfo_Text"
mpf.UseSystemPasswordChar = True

Dim mlf2 As New GrapeCity.Win.Spread.InputMan.CellType.Fields.MaskLiteralFieldInfo("}}: ")
mlf2.BackColor = Color.Aqua
mlf2.ForeColor = Color.Black
mlf2.Margin = New System.Windows.Forms.Padding(4)
mlf2.Name = "MaskLiteralFieldInfo2"
mlf2.Font = SystemFonts.DefaultFont

Dim mef As New GrapeCity.Win.Spread.InputMan.CellType.Fields.MaskEnumerationFieldInfo(New String() {"item1", "item2", "item3", "item4"})
mef.AutoConvert = True
mef.AutoDropDown = True
mef.BackColor = Color.CadetBlue
mef.DropDownEnabled = True
mef.ForeColor = Color.Red
mef.PromptChar = "|"C
mef.SpinIncrement = 1
mef.Text = "MaskEnumerationFieldInfo"
mef.Font = SystemFonts.DefaultFont

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

gcMask.SideButtons.Add(New GrapeCity.Win.Spread.InputMan.CellType.SpinButtonInfo())

gcMask.Spin.AllowSpin = True
gcMask.Spin.Increment = 1
gcMask.Spin.SpinOnKeys = True
gcMask.Spin.SpinOnWheel = True
gcMask.Spin.Wrap = True

gcMask.UseSpreadDropDownButtonRender = 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

GcMaskCellType Class
GcMaskCellType Members

 

 


Copyright © GrapeCity, inc. All rights reserved.