MESCIUS SPREAD for Windows Forms 15.0J
SetModelScopeCustomNameComment メソッド (DefaultSheetDataModel)
使用例 

設定するカスタム名の名前。
カスタム名のコメント。
カスタム名のコメントを設定します。
構文
'宣言
 
Public Function SetModelScopeCustomNameComment( _
   ByVal name As String, _
   ByVal comment As String _
) As Boolean
public bool SetModelScopeCustomNameComment( 
   string name,
   string comment
)

パラメータ

name
設定するカスタム名の名前。
comment
カスタム名のコメント。

戻り値の型

成功した場合はtrue、それ以外の場合はfalse
使用例
次のサンプルコードは、SetModelScopeCustomNameCommentメソッドを使用します。
FarPoint.Win.Spread.Model.ISheetDataModel model1 = fpSpread1.Sheets[0].Models.Data;
FarPoint.Win.Spread.Model.DefaultSheetDataModel modelCustomNameSupport = model1 as FarPoint.Win.Spread.Model.DefaultSheetDataModel;
FarPoint.CalcEngine.Expression exp1 = new FarPoint.CalcEngine.CellExpression(0, 0);
modelCustomNameSupport.AddModelScopeCustomName("Test_1", exp1, "comment of sheet scope custom name"); //Custom name for sheetview
modelCustomNameSupport.AddCustomName("Test_2", exp1, "comment of workbook scope custom name"); //Custom name for workbook
//Can use this method to change an existing comment
modelCustomNameSupport.SetModelScopeCustomNameComment("Test_1", "Changed comment");
string comment = modelCustomNameSupport.GetModelScopeCustomNameComment("Test_1");
string comment1 = modelCustomNameSupport.GetCustomNameComment("Test_2");
listBox1.Items.Add(comment);
listBox1.Items.Add(comment1);
Dim model1 As FarPoint.Win.Spread.Model.ISheetDataModel = FpSpread1.Sheets(0).Models.Data
Dim modelCustomNameSupport As FarPoint.Win.Spread.Model.DefaultSheetDataModel = TryCast(model1, FarPoint.Win.Spread.Model.DefaultSheetDataModel)
Dim exp1 As FarPoint.CalcEngine.Expression = New FarPoint.CalcEngine.CellExpression(0, 0)
'Custom name for sheetview
modelCustomNameSupport.AddModelScopeCustomName("Test_1", exp1, "comment of sheet scope custom name")
'Custom name for workbook
modelCustomNameSupport.AddCustomName("Test_2", exp1, "comment of workbook scope custom name")
'Can use this method to change an existing comment
modelCustomNameSupport.SetModelScopeCustomNameComment("Test_1", "Changed comment")
Dim comment As String = modelCustomNameSupport.GetModelScopeCustomNameComment("Test_1")
Dim comment1 As String = modelCustomNameSupport.GetCustomNameComment("Test_2")
ListBox1.Items.Add(comment)
ListBox1.Items.Add(comment1)
参照

DefaultSheetDataModel クラス
DefaultSheetDataModel メンバ

 

 


© MESCIUS inc. All rights reserved.