-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPreferencesWindow.cs
More file actions
63 lines (55 loc) · 1.88 KB
/
PreferencesWindow.cs
File metadata and controls
63 lines (55 loc) · 1.88 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
using Amaoto;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static TestProject.SongData;
namespace TestProject
{
public partial class PreferencesWindow : Form
{
bool changed_backpic;
public PreferencesWindow()
{
InitializeComponent();
}
public void Enable()
{
label2.Text = Properties.Settings.Default.BackgroundPicPath;
}
private void button2_Click(object sender, EventArgs e)
{
Properties.Settings.Default.Reload();
this.Close();
}
private void button1_Click(object sender, EventArgs e)
{
((MainWindow)this.Owner).BackgroundImage = Image.FromFile(Properties.Settings.Default.BackgroundPicPath);
Properties.Settings.Default.Save();
this.Close();
}
private void Button_MusicChoose_Click(object sender, EventArgs e)
{
using (OpenFileDialog openFileDialog = new OpenFileDialog())
{
openFileDialog.Filter = "PNGファイル (*.png)|*.png|JPGファイル (*.jpg)|*.jpg";
openFileDialog.FilterIndex = 1;
openFileDialog.RestoreDirectory = true;
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
if (Properties.Settings.Default.BackgroundPicPath == openFileDialog.FileName) return;
Properties.Settings.Default.BackgroundPicPath = openFileDialog.FileName;
label2.Text = openFileDialog.FileName;
label1.Text = "背景画像*";
changed_backpic = true;
}
}
}
}
}