- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOpenFileOptionsDialog.cs
More file actions
Latest commit
73 lines (58 loc) · 1.84 KB
/
Copy pathOpenFileOptionsDialog.cs
File metadata and controls
73 lines (58 loc) · 1.84 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
//
// Copyright 2020 - Jeffrey "botman" Broome
//
usingSystem;
usingSystem.Windows.Forms;
usingSystem.Drawing;
namespaceOpenFileByName
{
publicpartialclassOpenFileOptionsDialog:Form
{
publicFontNewFont=null;
publicOpenFileOptionsDialog(ListViewFileListView)
{
InitializeComponent();
UseSelectedText_Checkbox.Checked=Properties.Settings.Default.UseSelectedText;
CloseOnDoubleclick_Checkbox.Checked=Properties.Settings.Default.CloseDialogOnDoubleclick;
NewFont=FileListView.Font;
textBox1.Text=string.Format(@"{0} {1} pt {2}",FileListView.Font.Name,FileListView.Font.Size,FileListView.Font.Style.ToString());
DialogResult=DialogResult.Cancel;
}
privatevoidOpenFileOptions_Shown(objectsender,EventArgse)
{
CenterToParent();
}
privatevoidOKButton_Click(objectsender,EventArgse)
{
Properties.Settings.Default.UseSelectedText=UseSelectedText_Checkbox.Checked;
Properties.Settings.Default.CloseDialogOnDoubleclick=CloseOnDoubleclick_Checkbox.Checked;
Properties.Settings.Default.FontFamilyName=NewFont.FontFamily.Name;
Properties.Settings.Default.FontStyle=(int)NewFont.Style;
Properties.Settings.Default.FontSizeInPoints=NewFont.SizeInPoints;
Properties.Settings.Default.FontGraphicsUnit=(int)NewFont.Unit;
Properties.Settings.Default.Save();
DialogResult=DialogResult.OK;
Close();
}
privatevoidCancelButton_Click(objectsender,EventArgse)
{
Close();
}
privatevoidbutton1_Click(objectsender,EventArgse)
{
FontDialogfontDialog=newFontDialog();
fontDialog.Font=NewFont;
try
{
if(fontDialog.ShowDialog()!=DialogResult.Cancel)
{
NewFont=fontDialog.Font;
textBox1.Text=string.Format(@"{0} {1} pt {2}",NewFont.Name,NewFont.Size,NewFont.Style.ToString());
}
}
catch
{
}
}
}
}