FrmBasePoint.cs
1.2 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
using System;
using System.Windows.Forms;
namespace ConveyorLine.EditPointCode
{
public partial class FrmBasePoint : Form
{
public FrmBasePoint()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
var code = numPointCode.Value;
var x = (int)numX.Value;
var y = (int)numY.Value;
var find = EditPointCodeHelper.pointCodes.Find(s => s.Id == code);
if (find != null)
{
find.X = x;
find.Y = y;
EditPointCodeHelper.BasePointCode = find;
Close();
}
else
{
MessageBox.Show($"无法设置该地标为基准点【{code}】,因不存在");
}
}
private void numPointCode_ValueChanged(object sender, EventArgs e)
{
var code = numPointCode.Value;
var find = EditPointCodeHelper.pointCodes.Find(s => s.Id == code);
if (find == null)
{
MessageBox.Show("不存在的地码,请检查");
}
}
}
}