PowerTools PlusPak for Windows Forms 8.0J
Add(DateTime,CalendarNote) メソッド
使用例 

メモに関連付けられた日付を示す System.DateTime 値。
コレクションに追加する CalendarNote
CalendarNote をコレクションに追加し、そのメモを指定した日付に関連付けます。
構文
Public Overloads Sub Add( _
   ByVal date As Date, _
   ByVal note As CalendarNote _
) 
public void Add( 
   DateTime date,
   CalendarNote note
)

パラメータ

date
メモに関連付けられた日付を示す System.DateTime 値。
note
コレクションに追加する CalendarNote
使用例

次のサンプルコードは、GcCalendar コントロールにメモを追加する方法を示します。

private void CreateCalendarWithNote()
{
    // Create a GcCalendar.
    GcCalendar gcCalendar1 = new GcCalendar();
    gcCalendar1.Size = new Size(500, 500);
    gcCalendar1.CalendarType = CalendarType.MonthDay;

    // Set the appearance and behavior for NoteArea.
    gcCalendar1.ShowNotes = true;
    gcCalendar1.AllowDragDropNote = true;
    gcCalendar1.NoteArea.NoteAreaAlignment = NoteAreaAlignment.Right;
    gcCalendar1.NoteArea.BackColor = Color.LightBlue;
    gcCalendar1.NoteArea.BorderStyle = BorderStyle.FixedSingle;
    gcCalendar1.NoteArea.SingleBorderColor = Color.DarkBlue;

    // Add 4 notes to today.
    gcCalendar1.Notes.Add(DateTime.Today, new CalendarNote("Note1", null, NoteDisplayMode.Text));
    gcCalendar1.Notes.Add(DateTime.Today, new CalendarNote("Note2", null, NoteDisplayMode.Text));
    gcCalendar1.Notes.Add(DateTime.Today, new CalendarNote("Note3", null, NoteDisplayMode.Text));
    gcCalendar1.Notes.Add(DateTime.Today, new CalendarNote("Note4", null, NoteDisplayMode.Text));

    this.Controls.Add(gcCalendar1);
}
Private Sub CreateCalendarWithNote()
    ' Create a GcCalendar.
    Dim gcCalendar1 As New GcCalendar()
    gcCalendar1.Size = New Size(500, 500)
    gcCalendar1.CalendarType = CalendarType.MonthDay

    ' Set the appearance and behavior for NoteArea.
    gcCalendar1.ShowNotes = True
    gcCalendar1.AllowDragDropNote = True
    gcCalendar1.NoteArea.NoteAreaAlignment = NoteAreaAlignment.Right
    gcCalendar1.NoteArea.BackColor = Color.LightBlue
    gcCalendar1.NoteArea.BorderStyle = BorderStyle.FixedSingle
    gcCalendar1.NoteArea.SingleBorderColor = Color.DarkBlue

    ' Add 4 notes to today.
    gcCalendar1.Notes.Add(DateTime.Today, New CalendarNote("Note1", Nothing, NoteDisplayMode.Text))
    gcCalendar1.Notes.Add(DateTime.Today, New CalendarNote("Note2", Nothing, NoteDisplayMode.Text))
    gcCalendar1.Notes.Add(DateTime.Today, New CalendarNote("Note3", Nothing, NoteDisplayMode.Text))
    gcCalendar1.Notes.Add(DateTime.Today, New CalendarNote("Note4", Nothing, NoteDisplayMode.Text))

    Me.Controls.Add(gcCalendar1)
End Sub
プラットフォーム

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

参照

CalendarNoteCollection クラス
CalendarNoteCollection メンバ
オーバーロード一覧

Send Feedback