This repository was archived by the owner on Feb 28, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForm2.cs
More file actions
79 lines (64 loc) · 2.22 KB
/
Copy pathForm2.cs
File metadata and controls
79 lines (64 loc) · 2.22 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using System;
using System.Windows.Forms;
namespace PowerCacheOffice
{
internal partial class Form2 : Form
{
public static readonly int No = 0;
public static readonly int Yes = 1;
public static readonly int Confirm = 2;
public static readonly int ConfirmDiffTool = 3;
public int Result { get; set; }
private int initialWidth = 0;
private int initialHeight = 0;
protected override void WndProc(ref Message m)
{
const int WM_DPICHANGED = 0x02E0;
if (m.Msg == WM_DPICHANGED)
{
float f = NativeMethods.GetDpiForSystem();
this.Width = (int)Math.Round(initialWidth * (this.DeviceDpi / f));
this.Height = (int)Math.Round(initialHeight * (this.DeviceDpi / f));
return;
};
base.WndProc(ref m);
}
public Form2(string filePath, bool isDarkMode)
{
InitializeComponent();
initialWidth = this.Width;
initialHeight = this.Height;
float f = NativeMethods.GetDpiForSystem();
this.Width = (int)Math.Round(initialWidth * (this.DeviceDpi / f));
this.Height = (int)Math.Round(initialHeight * (this.DeviceDpi / f));
Program.SortTabIndex(this);
Program.ChangeDarkMode(this, isDarkMode);
Result = No;
label1.Text = "このファイルは更新中に変更された可能性があります。\n上書きしてよろしいですか?\n\n" + filePath;
}
private void Form2_Load(object sender, EventArgs e)
{
button4.Focus();
}
private void button1_Click(object sender, EventArgs e)
{
Result = Yes;
this.Close();
}
private void button2_Click(object sender, EventArgs e)
{
Result = No;
this.Close();
}
private void button3_Click(object sender, EventArgs e)
{
Result = Confirm;
this.Close();
}
private void button5_Click(object sender, EventArgs e)
{
Result = ConfirmDiffTool;
this.Close();
}
}
}