-
Notifications
You must be signed in to change notification settings - Fork 186
/
Copy pathCalendar.cs
29 lines (26 loc) · 986 Bytes
/
Calendar.cs
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
using System;
using System.Windows.Forms;
namespace HighDpiDemo
{
public partial class Calendar : Form
{
public Calendar()
{
InitializeComponent();
if (MainForm.SettingsCollection != null)
{
string value = MainForm.SettingsCollection.Get("MonthCalendar.DisableHighDpiImprovements");
bool enabled = !string.Equals("true", value, StringComparison.InvariantCultureIgnoreCase);
label1.Text = "Calendar HDPI Improvement is " + (enabled?"enabled":"disabled");
}
}
private void Calendar_Load(object sender, EventArgs e)
{
currentDpiLabel.Text = $"Current scaling = {(int)Math.Round((DeviceDpi / 96.0) * 100)}%";
}
private void Calendar_DpiChanged(object sender, DpiChangedEventArgs e)
{
currentDpiLabel.Text = $"Current scaling = {(int)Math.Round((DeviceDpi / 96.0) * 100)}%";
}
}
}