private void Form1_Load(object sender, System.EventArgs e)
{
//デフォルトの日付型セルを設定します
FarPoint.Win.Spread.CellType.DateTimeCellType dt1 = new FarPoint.Win.Spread.CellType.DateTimeCellType();
fpSpread1.ActiveSheet.Cells[1, 1].CellType = dt1;
fpSpread1.ActiveSheet.SetValue(1, 1, new DateTime(2015, 6, 15));
//和暦を設定します
FarPoint.Win.Spread.CellType.DateTimeCellType dt2 = new FarPoint.Win.Spread.CellType.DateTimeCellType();
dt2.Calendar = new System.Globalization.JapaneseCalendar();
dt2.DateTimeFormat = FarPoint.Win.Spread.CellType.DateTimeFormat.UserDefined;
dt2.UserDefinedFormat = "gg yy年M月d日";
fpSpread1.ActiveSheet.Cells[1, 2].CellType = dt2;
fpSpread1.ActiveSheet.SetValue(1, 2, new DateTime(2015, 6, 15));
fpSpread1.ActiveSheet.Cells[1, 1].BackColor = Color.LemonChiffon;
fpSpread1.ActiveSheet.Cells[1, 2].BackColor = Color.LightPink;
fpSpread1.ActiveSheet.Columns[1, 2].Width = 100;
}
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
'デフォルトの日付型セルを設定します
Dim dt1 As New FarPoint.Win.Spread.CellType.DateTimeCellType
FpSpread1.ActiveSheet.Cells(1, 1).CellType = dt1
FpSpread1.ActiveSheet.SetValue(1, 1, New DateTime(2015, 6, 15))
'和暦を設定します
Dim dt2 As New FarPoint.Win.Spread.CellType.DateTimeCellType
dt2.Calendar = New System.Globalization.JapaneseCalendar
dt2.DateTimeFormat = FarPoint.Win.Spread.CellType.DateTimeFormat.UserDefined
dt2.UserDefinedFormat = "gg yy年M月d日"
FpSpread1.ActiveSheet.Cells(1, 2).CellType = dt2
FpSpread1.ActiveSheet.SetValue(1, 2, New DateTime(2015, 6, 15))
FpSpread1.ActiveSheet.Cells(1, 1).BackColor = Color.LemonChiffon
FpSpread1.ActiveSheet.Cells(1, 2).BackColor = Color.LightPink
FpSpread1.ActiveSheet.Columns(1, 2).Width = 100
End Sub