-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathProfileUserSetting.cs
More file actions
62 lines (50 loc) · 1.74 KB
/
ProfileUserSetting.cs
File metadata and controls
62 lines (50 loc) · 1.74 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
// This is an independent project of an individual developer. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using ToolsGenGkode.pages;
namespace ToolsGenGkode
{
public partial class ProfileUserSetting : Form
{
public List<UserCommand> uc;
public ProfileUserSetting()
{
InitializeComponent();
}
private void ProfileUserSetting_Load(object sender, EventArgs e)
{
foreach (UserCommand VARIABLE in uc)
{
Panel pn = new Panel();
pn.Name = "pn" + VARIABLE.Name;
pn.Width = 250;
pn.Height = 60;
Label lb = new Label();
lb.Name = "lb"+ VARIABLE.Name;
lb.Text = VARIABLE.Description;
NumericUpDown num = new NumericUpDown();
num.Name = "num" + VARIABLE.Name;
num.Top = 30;
num.Minimum = -999999;
num.Maximum = 999999;
num.DecimalPlaces = 3;
num.Value = (decimal)VARIABLE.Value;
pn.Controls.Add(lb);
pn.Controls.Add(num);
flowLayoutPanel1.Controls.Add(pn);
}
}
private void button1_Click(object sender, EventArgs e)
{
int indx = 0;
foreach (UserCommand VARIABLE in uc)
{
decimal mmm = ((System.Windows.Forms.NumericUpDown) (flowLayoutPanel1.Controls[indx].Controls[1])).Value;
VARIABLE.Value = (double)mmm;
indx++;
}
}
}
}