-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMonthCalendar.cs
More file actions
36 lines (29 loc) · 1.36 KB
/
MonthCalendar.cs
File metadata and controls
36 lines (29 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Diagnostics;
using System.Windows.Forms;
namespace Examples {
class MainForm : Form {
public static void Main() {
Application.EnableVisualStyles();
Application.Run(new MainForm());
}
public MainForm() {
Text = "MonthCalendar example";
monthCalendar1.Parent = this;
monthCalendar1.MinDate = new DateTime(1971, 1, 5);
monthCalendar1.MaxDate = new DateTime(2071, 1, 5);
monthCalendar1.SelectionRange = new SelectionRange(DateTime.Now - TimeSpan.FromDays(1), DateTime.Now + TimeSpan.FromDays(1));
monthCalendar1.Location = new System.Drawing.Point(10, 10);
monthCalendar1.DateChanged += delegate {
Debug.WriteLine(string.Format("DateChanged range = [{0}; {1}]", monthCalendar1.SelectionRange.Start.ToShortDateString(), monthCalendar1.SelectionRange.End.ToShortDateString()), "Date selected :");
};
monthCalendar1.DateSelected += delegate {
Debug.WriteLine(string.Format("DateSelected range = [{0}; {1}]", monthCalendar1.SelectionRange.Start.ToShortDateString(), monthCalendar1.SelectionRange.End.ToShortDateString()), "Date selected :");
};
monthCalendar1.TextChanged += delegate {
Debug.WriteLine(string.Format("TextChanged text = {0}", monthCalendar1.Text));
};
}
private MonthCalendar monthCalendar1 = new MonthCalendar();
}
}