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

入力候補値を表示するかどうかを取得または設定します。
構文
'宣言
 
Public Property ShowRecommendedValue As Boolean
public bool ShowRecommendedValue {get; set;}

プロパティ値

入力候補値を表示する場合はtrue。それ以外の場合はfalse

デフォルト値はfalseです。
解説
このShowRecommendedValuetrueの場合、値が完全に入力されていないときにGcTimeSpan.RecommendedValueプロパティの値が表示されます。それ以外の場合、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 メンバ
RecommendedValue プロパティ

 

 


© MESCIUS inc. All rights reserved.