Example
The following example creates two controls with their first row containing date cells. The first Spread control's date cells' pop-up calendars display French words or abbreviations for the day and month names. For the accented characters, é is ASCII character 233 and û is ASCII character 251.
The second Spread control's date cells' pop-up calendars display English abbreviations for the day and month names.
C++
void CmyWnd::MyFunc()
{
// Specify the first row to contain date cells
m_Spread1.SetCol(-1);
m_Spread1.SetRow(1);
m_Spread1.SetCellType(CellTypeDate);
m_Spread1.SetCol(-1);
m_Spread1.SetRow(1);
m_Spread1.SetCellType(CellTypeDate);
// Provide the short and long text for days and
// months in the pop-up calendar. Specify that the
// day/month text and OK/Cancel buttons display in
// the pop-up calendar (First Spread control)
m_Spread1.SetCalText("D\tL\tM\tM\tJ\tV\tS", "Dimanche\tLundi\tMardi\tMercredi\tJeudi\tVendredi\tSamedi", "J\tF\tM\tA\tM\tJ\tJ\tA\tS\tO\tN\tD", "Janvier\tF\351vrier\tMars\tAvril\tMai\tJuin\tJuillet\tAo\373t\tSeptembre\tOctobre\tNovembre\tD\351cembre" , "OK", "Annuler");
// Provide the short and long text for days and
// months in the pop-up calendar. Specify that the
// day/month text and OK/Cancel buttons display in
// the pop-up calendar (Second Spread control)
m_Spread2.SetCalTextOverride("MO\tTU\tWE\tTH\tFR\tSA\tSU", "MON\tTUE\tWED\tTHU\tFRI\tSAT\tSUN", "JAN\tFEB\tMAR\tAPR\tMAY\tJUN\tJUL\tAUG\tSEP\tOCT\tNOV\tDEC", "JANU\tFEBR\tMARC\tAPRI\tMAY\tJUNE\tJULY\tAUGUt\tSEPT\tOCTO\tNOVE\tDECE", "Accept", "Deny");
}
Visual Basic
Sub Form_Load()
' Declare a variable for the tab character
Dim T$
T$ = Chr(9)
' Specify the first row to contain date cells
fpSpread1.Col = -1
fpSpread1.Row = 1
fpSpread1.CellType = CellTypeDate
fpSpread2.Col = -1
fpSpread2.Row = 1
fpSpread2.CellType = CellTypeDate
' Provide the short and long text for days and months
' in the pop-up calendar of the first Spread
ShortDays1$ = "D" + T$ + "L" + T$ + "M" + T$ + "M" + T$ + "J" + T$ + "V" + T$ + "S"
LongDays1$ = "Dimanche" + T$ + "Lundi" + T$ + "Mardi" + T$ + "Mercredi" + T$ + "Jeudi" + T$ + "Vendredi" + T$ + "Samedi"
ShortMonth1$ = "J" + T$ + "F" + T$ + "M" + T$ + "A" + T$ + "M" + T$ + "J" + T$ + "J" + T$ + "A" + T$ + "S" + T$ + "O" + T$ + "N" + T$ + "D"
LongMonth1$ = "Janvier" + T$ + "F" + Chr(233) + "vrier" + T$ + "Mars" + T$ + "Avril" + T$ + "Mai" + T$ + "Juin" + T$ + "Juillet" + T$ + "Ao" + Chr(251) + "t" + T$ + "Septembre" + T$ + "Octobre" + T$ + "Novembre" + T$ + "D" + Chr(233) + "cembre"
' Specify that the day/month text and OK/Cancel
' buttons display in the pop-up calendar
Call fpSpread1.SetCalText(ShortDays1$, LongDays1$, ShortMonth1$, LongMonth1$, "OK", "Annuler")
' Provide the short and long text for days and months
' in the pop-up calendar of the second Spread
ShortDays2$ = "MO" + T$ + "TU" + T$ + "WE" + T$ + "TH" + T$ + "FR" + T$ + "SA" + T$ + "SU"
LongDays2$ = "MON" + T$ + "TUE" + T$ + "WED" + T$ + "THU" + T$ + "FRI" + T$ + "SAT" + T$ + "SUN"
ShortMonths2$ = "JAN" + T$ + "FEB" + T$ + "MAR" + T$ + "APR" + T$ + "MAY" + T$ + "JUN" + T$ + "JUL" + T$ + "AUG" + T$ + "SEP" + T$ + "OCT" + T$ + "NOV" + T$ + "DEC"
LongMonths2$ = "JANU" + T$ + "FEBR" + T$ + "MARC" + T$ + "APRI" + T$ + "MAY" + T$ + "JUNE" + T$ + "JULY" + T$ + "AUGU" + T$ + "SEPT" + T$ + "OCTO" + T$ + "NOVE" + T$ + "DECE"
Call fpSpread2.SetCalTextOverride(ShortDays2$, LongDays2$, ShortMonths2$, LongMonths2$, "Accept", "Deny")
End Sub