MESCIUS SPREAD for Windows Forms 15.0J
RecommendedValue プロパティ (GcMaskCellType)
使用例 

入力候補値を取得または設定します。
構文
'宣言
 
Public Property RecommendedValue As String
public string RecommendedValue {get; set;}

プロパティ値

テキストの回転を示すSystem.String値。
デフォルト値はSystem.String.Emptyです。
例外
例外解説
System.ArgumentException
解説
RecommendedValueプロパティはユーザーへのヒントを提供するもので、値が完全に入力されていないときに表示されます。値の入力中に特定のショートカットキーまたはキーの組み合わせを押すと、入力候補値を取得できます。
使用例
次のサンプルコードは、GcMaskセルを作成します。
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
参照

GcMaskCellType クラス
GcMaskCellType メンバ
ShowRecommendedValue プロパティ

 

 


© MESCIUS inc. All rights reserved.