-
Notifications
You must be signed in to change notification settings - Fork 0
/
SetupForm.vb
143 lines (99 loc) · 4.84 KB
/
SetupForm.vb
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
Imports System.Diagnostics.Tracing
Imports System.Reflection
Imports GridOnScreenIST.GridPictureBox 'Импорт пространста имен из основной формы
Public Class SetupForm
Public Sub UpVarForSetupForm()
'Импорт значений из основной формы
Me.SGSize.Value = GridPictureBox.SGSizeMesh
Me.SGValSize.Text = GridPictureBox.SGSizeMesh.ToString
Me.MGSize.Value = GridPictureBox.MGSizeMesh
Me.MGValSize.Text = GridPictureBox.MGSizeMesh.ToString
Me.LGSize.Value = GridPictureBox.LGSizeMesh
Me.LGValSize.Text = GridPictureBox.LGSizeMesh.ToString
Me.SGLineThick.Value = GridPictureBox.Pen1.Width
Me.SGValThick.Text = GridPictureBox.Pen1.Width.ToString
Me.MGLineThick.Value = GridPictureBox.Pen2.Width
Me.MGValThick.Text = GridPictureBox.Pen2.Width.ToString
Me.LGLineThick.Value = GridPictureBox.Pen3.Width
Me.LGValThick.Text = GridPictureBox.Pen3.Width.ToString
Me.MeOpacity.Value = GridPictureBox.Opacity * 10
Me.MeValOpacity.Text = GridPictureBox.Opacity.ToString
End Sub
Private Sub SGSetColor_Click(sender As Object, e As EventArgs) Handles SGSetColor.Click
If SGColor.ShowDialog = DialogResult.OK Then
GridPictureBox.Pen1.Color = SGColor.Color
GridPictureBox.ViewPictureBox.Invalidate()
End If
End Sub
Private Sub MGSetColor_Click(sender As Object, e As EventArgs) Handles MGSetColor.Click
If SGColor.ShowDialog = DialogResult.OK Then
GridPictureBox.Pen2.Color = SGColor.Color
GridPictureBox.ViewPictureBox.Invalidate()
End If
End Sub
Private Sub LGSetColor_Click(sender As Object, e As EventArgs) Handles LGSetColor.Click
If SGColor.ShowDialog = DialogResult.OK Then
GridPictureBox.Pen3.Color = SGColor.Color
GridPictureBox.ViewPictureBox.Invalidate()
End If
End Sub
Private Sub SGSize_Scroll(sender As Object, e As EventArgs) Handles SGSize.Scroll
GridPictureBox.SGSizeMesh = SGSize.Value
Me.SGValSize.Text = GridPictureBox.SGSizeMesh
SGSize.Invalidate()
GridPictureBox.ViewPictureBox.Invalidate()
End Sub
Private Sub MGSize_Scroll(sender As Object, e As EventArgs) Handles MGSize.Scroll
GridPictureBox.MGSizeMesh = MGSize.Value
Me.MGValSize.Text = GridPictureBox.MGSizeMesh
MGSize.Invalidate()
GridPictureBox.ViewPictureBox.Invalidate()
End Sub
Private Sub LGSize_Scroll(sender As Object, e As EventArgs) Handles LGSize.Scroll
GridPictureBox.LGSizeMesh = LGSize.Value
Me.LGValSize.Text = GridPictureBox.LGSizeMesh
LGSize.Invalidate()
GridPictureBox.ViewPictureBox.Invalidate()
End Sub
Private Sub SGLineThick_Scroll(sender As Object, e As EventArgs) Handles SGLineThick.Scroll
GridPictureBox.Pen1.Width = SGLineThick.Value
Me.SGValThick.Text = GridPictureBox.Pen1.Width
SGValThick.Invalidate()
GridPictureBox.ViewPictureBox.Invalidate()
End Sub
Private Sub MGLineThick_Scroll(sender As Object, e As EventArgs) Handles MGLineThick.Scroll
GridPictureBox.Pen2.Width = MGLineThick.Value
Me.MGValThick.Text = GridPictureBox.Pen2.Width
MGValThick.Invalidate()
GridPictureBox.ViewPictureBox.Invalidate()
End Sub
Private Sub LGLineThick_Scroll(sender As Object, e As EventArgs) Handles LGLineThick.Scroll
GridPictureBox.Pen3.Width = LGLineThick.Value
Me.LGValThick.Text = GridPictureBox.Pen3.Width
LGValThick.Invalidate()
GridPictureBox.ViewPictureBox.Invalidate()
End Sub
Private Sub MeOpacity_Scroll(sender As Object, e As EventArgs) Handles MeOpacity.Scroll
GridPictureBox.Opacity = MeOpacity.Value / 10
Me.MeValOpacity.Text = GridPictureBox.Opacity.ToString
MeValOpacity.Invalidate()
End Sub
Private Sub ResettoDefault_Click(sender As Object, e As EventArgs) Handles resettoDefault.Click
'Возврат к значениям по умолчанию Цвета и Толщины
GridPictureBox.Pen1.Color = Color.FromArgb(255, 68, 68)
GridPictureBox.Pen1.Width = 1
GridPictureBox.Pen2.Color = Color.FromArgb(255, 0, 0, 255)
GridPictureBox.Pen2.Width = 2
GridPictureBox.Pen3.Color = Color.FromArgb(255, 0, 255, 0)
GridPictureBox.Pen3.Width = 4
'Возврат к значениям по умолчанию размеров ячейки сетки
GridPictureBox.SGSizeMesh = 25
GridPictureBox.MGSizeMesh = 100
GridPictureBox.LGSizeMesh = 400
GridPictureBox.Opacity = 0.2
GridPictureBox.ViewPictureBox.Invalidate()
UpVarForSetupForm()
Me.Refresh()
'Me.Close()
End Sub
End Class