MESCIUS SPREAD for Windows Forms 17.0J
PreventFocusLeave プロパティ

検証対象のCellにフォーカスを維持するかどうかを取得または設定します。
構文
'Declaration
 
Public Property PreventFocusLeave As Boolean
public bool PreventFocusLeave {get; set;}

プロパティ値

検証対象のCellにフォーカスを維持する場合はtrue、それ以外の場合はfalse。デフォルト値はtrueです。
次のサンプルコードは、値が無効なセルにフォーカスを維持します。
//Typing a value outside the range prevents focus from leaving the cell
FarPoint.Win.Spread.FocusProcess cnotify = new FarPoint.Win.Spread.FocusProcess();
cnotify.PreventFocusLeave = true;
FarPoint.Win.Spread.TextLengthValidator tvalid = new FarPoint.Win.Spread.TextLengthValidator();
tvalid.LengthUnit = FarPoint.Win.Spread.LengthUnit.Char;
tvalid.MaximumLength = 6;
tvalid.MinimumLength = 0;
tvalid.Actions.Add(cnotify);
fpSpread1.Sheets[0].AddValidators(new FarPoint.Win.Spread.Model.CellRange(1, 1, 1, 1), tvalid);
'Typing a value outside the range prevents focus from leaving the cell
Dim cnotify As New FarPoint.Win.Spread.FocusProcess()
cnotify.PreventFocusLeave = True
Dim tvalid As New FarPoint.Win.Spread.TextLengthValidator()
tvalid.LengthUnit = FarPoint.Win.Spread.LengthUnit.Char
tvalid.MaximumLength = 6
tvalid.MinimumLength = 0
tvalid.Actions.Add(cnotify)
FpSpread1.Sheets(0).AddValidators(New FarPoint.Win.Spread.Model.CellRange(1, 1, 1, 1), tvalid)
参照

FocusProcess クラス
FocusProcess メンバ

 

 


© MESCIUS inc. All rights reserved.