-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAbout.cs
61 lines (49 loc) · 1.94 KB
/
About.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
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
using Microsoft.Win32;
using ResourceCalculator.Properties;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ResourceCalculator
{
public partial class About : Form
{
public About()
{
InitializeComponent();
label1.Text += Form1.versionProg.ToString();
label2.Text += Application.ProductName;
/*using (RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\ResourceCalculator"))*/
/*labelReg.Text += key?.GetValue("DarkMode")?.ToString() == "true" ? true : false;*/
var key = Registry.CurrentUser.CreateSubKey(@"Software\ResourceCalculator");
if (key?.GetValue("DarkMode")?.ToString() == "true")
{
BackColor = Color.FromArgb(255, 29, 29, 29);
label1.ForeColor = Color.FromArgb(255, 255, 255, 255);
label2.ForeColor = Color.FromArgb(255, 255, 255, 255);
pictureBox1.Image = Resources.github_white;
}
else if (key?.GetValue("DarkMode")?.ToString() == "false")
{
BackColor = Color.FromArgb(255, 255, 255, 255);
label1.ForeColor = SystemColors.ControlText;
label2.ForeColor = SystemColors.ControlText;
pictureBox1.Image = Resources.github_dark;
}
}
private void pictureBox1_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Вы хотите перейти на сайт?", "Перейти на гитхаб", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
{
Process.Start("https://github.com/BZHStudio/ResourceCalculator");
}
}
}
}