FarPoint.Win.Spread アセンブリ > FarPoint.Win.Spread.CellType 名前空間 > DateTimeCellType クラス : TimeSeparator プロパティ |
時刻区切り記号は、時刻値の表示部分を時、分、秒に区切ります。たとえば、時刻値が "03:12:14" の場合は、コロン(:)文字が区切り記号になります。
時刻を表示する際の書式を指定するには、DateTimeFormat プロパティを設定します。
FarPoint.Win.Spread.CellType.DateTimeCellType datecell = new FarPoint.Win.Spread.CellType.DateTimeCellType(); datecell.AMString = "a.m. (morning)"; datecell.PMString = "p.m. (evening)"; datecell.DateSeparator = " | "; datecell.TimeSeparator = ":"; datecell.DateTimeFormat = FarPoint.Win.Spread.CellType.DateTimeFormat.ShortDateWithTime; datecell.MaximumDate = new System.DateTime(2010, 1, 1); datecell.MinimumDate = new System.DateTime(1990, 12, 31); datecell.MaximumTime = new System.TimeSpan(15, 59, 59); datecell.MinimumTime = new System.TimeSpan(11, 0, 0); datecell.SpinButton = true; fpSpread1.Sheets[0].Cells[7,2].CellType = datecell; fpSpread1.Sheets[0].Cells[7,2].Value = System.DateTime.Now;
Dim datecell As New FarPoint.Win.Spread.CellType.DateTimeCellType() datecell.AMString = "a.m. (morning)" datecell.PMString = "p.m. (evening)" datecell.DateSeparator = " | " datecell.TimeSeparator = ":" datecell.DateTimeFormat = FarPoint.Win.Spread.CellType.DateTimeFormat.ShortDateWithTime datecell.MaximumDate = new System.DateTime(2010, 1, 1) datecell.MinimumDate = new System.DateTime(1990, 12, 31) datecell.MaximumTime = new System.TimeSpan(15, 59, 59) datecell.MinimumTime = new System.TimeSpan(11, 0, 0) datecell.SpinButton = True fpSpread1.Sheets(0).Cells(7,2).CellType = datecell fpSpread1.Sheets(0).Cells(7,2).Value = System.DateTime.Now