作成日: 2020/06/26 最終更新日: 2020/06/26
文書種別
使用方法
詳細
C1CalendarViewで単一の日付や複数の日付を選択した時に、選択されたそれらの日付を取得するには、SelectionChangedイベントにてSelectedDatesプロパティを使用します。
◎サンプルコード(VB)
◎サンプルコード(VB)
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
'複数選択可能な日の最大数を指定
C1CalendarView1.MaxSelectionCount = 3
End Sub
Private Sub C1CalendarView1_SelectionChanged(sender As Object, e As EventArgs)
Dim i As Integer
For i = 0 To C1CalendarView1.SelectedDates.Count - 1
System.Diagnostics.Debug.WriteLine(C1CalendarView1.SelectedDates(i).ToString())
Next
End Sub
◎サンプルコード(C#) public Form1()
{
InitializeComponent();
// 複数選択可能な日の最大数を指定
c1CalendarView1.MaxSelectionCount = 3;
}
private void c1CalendarView1_SelectionChanged(object sender, EventArgs e)
{
for (int i = 0; i < c1CalendarView1.SelectedDates.Length; i++)
{
System.Diagnostics.Debug.WriteLine(c1CalendarView1.SelectedDates[i].ToString());
}
}
旧文書番号
85757