GrapeCity SPREAD for Windows Forms 12.0J
RequiredType プロパティ (RequiredTypeValidator)


指定した値の必要なSystem.Typeを取得または設定します。
構文
'Declaration
 
Public Property RequiredType As Type
'使用法
 
Dim instance As RequiredTypeValidator
Dim value As Type
 
instance.RequiredType = value
 
value = instance.RequiredType
public Type RequiredType {get; set;}

プロパティ値

指定した値の必要なSystem.Typeを表すSystem.Type値。デフォルト値はnull 参照 (Visual Basicでは Nothing)です。
次のサンプルコードでは、セル(1,1)を小数またはnullにする必要があります。
//Type a text string in cell 1,1 to see the error notification
FarPoint.Win.Spread.CellStyleNotify cnotify = new FarPoint.Win.Spread.CellStyleNotify();
cnotify.InvalidCellStyle.BackColor = Color.Aqua;
FarPoint.Win.Spread.RequiredTypeValidator requiredt = new FarPoint.Win.Spread.RequiredTypeValidator();
requiredt.RequiredType = typeof(decimal);
requiredt.NullIsValid = true;
requiredt.Actions.Add(cnotify);
fpSpread1.Sheets[0].AddValidators(new FarPoint.Win.Spread.Model.CellRange(1, 1, 1, 1), requiredt);
fpSpread1.Sheets[0].Cells[1, 1].Value = 5;
'Type a text string in cell 1,1 to see the error notification
Dim cnotify As New FarPoint.Win.Spread.CellStyleNotify()
cnotify.InvalidCellStyle.BackColor = Color.Aqua
Dim requiredt As New FarPoint.Win.Spread.RequiredTypeValidator()
requiredt.RequiredType = GetType(Decimal)
requiredt.NullIsValid = True
requiredt.Actions.Add(cnotify)
FpSpread1.Sheets(0).AddValidators(New FarPoint.Win.Spread.Model.CellRange(1, 1, 1, 1), requiredt)
FpSpread1.Sheets(0).Cells(1, 1).Value = 5
参照

RequiredTypeValidator クラス
RequiredTypeValidator メンバ

 

 


Copyright © 2004 GrapeCity inc.