GrapeCity CalendarGrid for Windows Forms 2.0J
DisplayFields プロパティ (CalendarGcDateTimeCellType)
使用例 

CalendarGcDateTimeCellType の表示フィールドを取得します。
構文
Public ReadOnly Property DisplayFields As DateTimeDisplayFieldCollection
public DateTimeDisplayFieldCollection DisplayFields {get;}

プロパティ値

表示フィールドのコレクションを示す DateTimeDisplayFieldCollection オブジェクト。
使用例
次のサンプルコードは、このプロパティに表示フィールドを追加する方法を示します。このサンプルコードは、CalendarGcDateTimeCellType に示されている詳細なコード例の一部を抜粋したものです。
private void SetGcDateCellDisplayFields(CalendarGcDateTimeCellType gcDateCell1)
{
    gcDateCell1.DisplayFields.Clear();

    DateYearDisplayField dateYearDisplayField1 = new DateYearDisplayField();
    DateLiteralDisplayField dateLiteralDisplayField2 = new DateLiteralDisplayField();
    DateMonthDisplayField dateMonthDisplayField1 = new DateMonthDisplayField();
    DateLiteralDisplayField dateLiteralDisplayField3 = new DateLiteralDisplayField();
    DateDayDisplayField dateDayDisplayField1 = new DateDayDisplayField();
    DateLiteralDisplayField dateLiteralDisplayField4 = new DateLiteralDisplayField();
    DateLiteralDisplayField dateLiteralDisplayField5 = new DateLiteralDisplayField();
    DateHourDisplayField dateHourDisplayField6 = new DateHourDisplayField();
    DateLiteralDisplayField dateLiteralDisplayField7 = new DateLiteralDisplayField();
    DateMinuteDisplayField dateMinuteDisplayField8 = new DateMinuteDisplayField();
    DateLiteralDisplayField dateLiteralDisplayField9 = new DateLiteralDisplayField();
    DateSecondDisplayField dateSecondDisplayField10 = new DateSecondDisplayField();

    dateLiteralDisplayField2.Text = "年";
    dateLiteralDisplayField3.Text = "月";
    dateLiteralDisplayField4.Text = "日";
    dateLiteralDisplayField7.Text = ":";
    dateLiteralDisplayField9.Text = ":";

    gcDateCell1.DisplayFields.AddRange(new DateDisplayField[] {
    dateYearDisplayField1,dateLiteralDisplayField2,dateMonthDisplayField1,dateLiteralDisplayField3,dateDayDisplayField1,dateLiteralDisplayField4,
    dateLiteralDisplayField5,dateHourDisplayField6,dateLiteralDisplayField7,dateMinuteDisplayField8,dateLiteralDisplayField9,dateSecondDisplayField10});
}
Private Sub SetGcDateCellDisplayFields(gcDateCell1 As CalendarGcDateTimeCellType)
    gcDateCell1.DisplayFields.Clear()

    Dim dateYearDisplayField1 As New DateYearDisplayField()
    Dim dateLiteralDisplayField2 As New DateLiteralDisplayField()
    Dim dateMonthDisplayField1 As New DateMonthDisplayField()
    Dim dateLiteralDisplayField3 As New DateLiteralDisplayField()
    Dim dateDayDisplayField1 As New DateDayDisplayField()
    Dim dateLiteralDisplayField4 As New DateLiteralDisplayField()
    Dim dateLiteralDisplayField5 As New DateLiteralDisplayField()
    Dim dateHourDisplayField6 As New DateHourDisplayField()
    Dim dateLiteralDisplayField7 As New DateLiteralDisplayField()
    Dim dateMinuteDisplayField8 As New DateMinuteDisplayField()
    Dim dateLiteralDisplayField9 As New DateLiteralDisplayField()
    Dim dateSecondDisplayField10 As New DateSecondDisplayField()

    dateLiteralDisplayField2.Text = "年"
    dateLiteralDisplayField3.Text = "月"
    dateLiteralDisplayField4.Text = "日"
    dateLiteralDisplayField7.Text = ":"
    dateLiteralDisplayField9.Text = ":"

    gcDateCell1.DisplayFields.AddRange(New DateDisplayField() {dateYearDisplayField1, dateLiteralDisplayField2, dateMonthDisplayField1, dateLiteralDisplayField3, dateDayDisplayField1, dateLiteralDisplayField4, _
        dateLiteralDisplayField5, dateHourDisplayField6, dateLiteralDisplayField7, dateMinuteDisplayField8, dateLiteralDisplayField9, dateSecondDisplayField10})
End Sub
参照

CalendarGcDateTimeCellType クラス
CalendarGcDateTimeCellType メンバ

 

 


c 2008 GrapeCity inc. All rights reserved.