GrapeCity SPREAD for Windows Forms 11.0J サンプルコード集
ポップアップカレンダーの表示をMonthCalendarコントロールと同等にする

日付型セルのSubEditorプロパティにSpreadDropDownMonthCalendarクラスを指定することで、ポップアップカレンダーの表示をMonthCalendarコントロールと同等にすることができます。

【実行例】

実行例

 private void Form1_Load(object sender, EventArgs e)
 {

  // 日付型セルのSubEditorプロパティにSpreadDropDownMonthCalendarクラスを指定します
  FarPoint.Win.Spread.CellType.DateTimeCellType datecell = new FarPoint.Win.Spread.CellType.DateTimeCellType();
  datecell.SubEditor = new FarPoint.Win.Spread.CellType.SpreadDropDownMonthCalendar();
  datecell.DropDownButton = true;
  fpSpread1.ActiveSheet.Cells[0, 0].CellType = datecell;
  fpSpread1.ActiveSheet.Cells[0, 0].Value = System.DateTime.Now;

  fpSpread1.ActiveSheet.Columns[0].Width = 100;

 }
 Private Sub CellType_17_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

  ' 日付型セルのSubEditorプロパティにSpreadDropDownMonthCalendarクラスを指定します
  Dim datecell As New FarPoint.Win.Spread.CellType.DateTimeCellType()
  datecell.SubEditor = New FarPoint.Win.Spread.CellType.SpreadDropDownMonthCalendar()
  datecell.DropDownButton = True
  FpSpread1.ActiveSheet.Cells(0, 0).CellType = datecell
  FpSpread1.ActiveSheet.Cells(0, 0).Value = System.DateTime.Now

  FpSpread1.ActiveSheet.Columns(0).Width = 100

 End Sub

 

 


© 2004-2018, GrapeCity inc. All rights reserved.