Spread Windows Forms 7.0 Product Documentation
SetCalendarText(String,String) Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.CellType Namespace > DateTimeCellType Class > SetCalendarText Method : SetCalendarText(String,String) Method


okText
Text for the OK button
cancelText
Text for the Cancel button

Glossary Item Box

Sets the various text elements for the pop-up calendar, namely the button text.

Syntax

Visual Basic (Declaration) 
Public Overloads Sub SetCalendarText( _
   ByVal okText As String, _
   ByVal cancelText As String _
) 
Visual Basic (Usage)Copy Code
Dim instance As DateTimeCellType
Dim okText As String
Dim cancelText As String
 
instance.SetCalendarText(okText, cancelText)
C# 
public void SetCalendarText( 
   string okText,
   string cancelText
)

Parameters

okText
Text for the OK button
cancelText
Text for the Cancel button

Example

This example sets the text for the OK and Cancel buttons on the calendar.
C#Copy Code
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;
Visual BasicCopy Code
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

Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.