MESCIUS SPREAD for Windows Forms 15.0J
SetCalendarText(String,String) メソッド
使用例 

OKボタンのテキスト
キャンセルボタンのテキスト
ポップアップカレンダーの各種テキスト要素(ボタンテキスト)を設定します。
構文
'宣言
 
Public Overloads Sub SetCalendarText( _
   ByVal okText As String, _
   ByVal cancelText As String _
) 
public void SetCalendarText( 
   string okText,
   string cancelText
)

パラメータ

okText
OKボタンのテキスト
cancelText
キャンセルボタンのテキスト
使用例
次のサンプルコードは、カレンダーの〈OK〉ボタンと〈キャンセル〉ボタンのテキストを設定します。
FarPoint.Win.Spread.CellType.DateTimeCellType dt = new FarPoint.Win.Spread.CellType.DateTimeCellType();
string[] dNames = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
string[] mNames = {"Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sep", "Oct", "Nov", "Dec",""};
string[] sdNames = {"SU", "M", "T", "W", "TH", "F", "S"};
string[] smNames = {"J", "F", "M", "A", "MY", "J", "JY", "AG", "S", "O", "N", "D",""};
string okbutn = "Accept";
string canbutn = "Decline";
dt.DateTimeFormat = FarPoint.Win.Spread.CellType.DateTimeFormat.UserDefined;
dt.UserDefinedFormat = "dddd  MMMM d,  yyyy";
dt.DayNames = dNames;
dt.MonthNames = mNames;
dt.ShortDayNames = sdNames;
dt.ShortMonthNames = smNames;
dt.SetCalendarText(okbutn, canbutn);
fpSpread1.ActiveSheet.Cells[0, 0].CellType = dt;
fpSpread1.ActiveSheet.Cells[0, 0].Value = System.DateTime.Now;
fpSpread1.ActiveSheet.Columns[0].Width = 130;
Dim dt As New FarPoint.Win.Spread.CellType.DateTimeCellType()
Dim dNames() As String = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}
Dim mNames() As String = {"Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sep", "Oct", "Nov", "Dec",""}
Dim sdNames() As String = {"SU", "M", "T", "W", "TH", "F", "S"}
Dim smNames() As String = {"J", "F", "M", "A", "MY", "J", "JY", "AG", "S", "O", "N", "D",""}
Dim okbutn As String = "Accept"
Dim canbutn As String = "Decline"
dt.DateTimeFormat = FarPoint.Win.Spread.CellType.DateTimeFormat.UserDefined
dt.UserDefinedFormat = "dddd  MMMM d,  yyyy"
dt.DayNames = dNames
dt.MonthNames = mNames
dt.ShortDayNames = sdNames
dt.ShortMonthNames = smNames
dt.SetCalendarText(okbutn, canbutn)
fpSpread1.ActiveSheet.Cells(0, 0).CellType = dt
fpSpread1.ActiveSheet.Cells(0, 0).Value = Now
fpSpread1.ActiveSheet.Columns(0).Width = 130
参照

DateTimeCellType クラス
DateTimeCellType メンバ
オーバーロード一覧

 

 


© MESCIUS inc. All rights reserved.