Spread Windows Forms 8.0 Product Documentation
ShortMonthNames Property
Example 


Gets or sets alternate short month names for the control (use with UserDefinedFormat).
Syntax
'Declaration
 
Public Property ShortMonthNames As String()
'Usage
 
Dim instance As DateTimeCellType
Dim value() As String
 
instance.ShortMonthNames = value
 
value = instance.ShortMonthNames
public string[] ShortMonthNames {get; set;}

Property Value

String array containing the abbreviated names of the months
Remarks

This can be applied individually to the cell and have an effect only if the format is UserDefined and in the format of "ddd MMM" for the two 'Short' properties and "dddd MMMM" for the other two.

For this property, the array must be one-dimensional and must have exactly 13 elements.

For more information on the one-dimensional string array containing the names of the months, refer to MonthNames topic in the Microsoft .NET Framework documentation.

Example
This example specifies the strings to use for the day names and month names when the format is "dddd MMMM d, yyyy".
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
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

Reference

DateTimeCellType Class
DateTimeCellType Members

 

 


Copyright © GrapeCity, inc. All rights reserved.