86 lines
2.2 KiB
C#
86 lines
2.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
|
|
namespace KMBIM
|
|
{
|
|
public partial class FormCoilZone : Form
|
|
{
|
|
public FormCoilZone()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
//코일 길이
|
|
private double _CoilLength;
|
|
public double CoilLength
|
|
{
|
|
get { return _CoilLength; }
|
|
set { _CoilLength = value; }
|
|
}
|
|
|
|
//존 수
|
|
private int _ZoneCount;
|
|
public int ZoneCount
|
|
{
|
|
get { return _ZoneCount; }
|
|
set { _ZoneCount = value; }
|
|
}
|
|
|
|
private void FormCoilZone_Load(object sender, EventArgs e)
|
|
{
|
|
this.KeyPreview = true;
|
|
//코일 길이
|
|
CoilLength = Math.Round(CoilLength, 3);
|
|
txt_CoilLength.Text = CoilLength.ToString();
|
|
|
|
//존 수
|
|
txt_CoilZone.Text = ZoneCount.ToString();
|
|
|
|
}
|
|
|
|
//코일 길이
|
|
private void txt_CoilLength_TextChanged(object sender, EventArgs e)
|
|
{
|
|
if (txt_CoilLength.Text == "") return;
|
|
CoilLength = double.Parse(txt_CoilLength.Text);
|
|
}
|
|
|
|
//존 수
|
|
private void txt_CoilZone_TextChanged(object sender, EventArgs e)
|
|
{
|
|
if (txt_CoilZone.Text == "") return;
|
|
ZoneCount = int.Parse(txt_CoilZone.Text);
|
|
}
|
|
|
|
private void FormCoilZone_KeyDown(object sender, KeyEventArgs e)
|
|
{
|
|
if (e.KeyCode == Keys.Escape)
|
|
{
|
|
//this.Close();
|
|
this.DialogResult = DialogResult.Cancel;
|
|
}
|
|
else if (e.KeyCode == Keys.Enter)
|
|
{
|
|
this.DialogResult = DialogResult.OK;
|
|
}
|
|
}
|
|
|
|
private void txt_CoilZone_KeyPress(object sender, KeyPressEventArgs e)
|
|
{
|
|
//숫자만 입력되도록 필터링
|
|
if (!(char.IsDigit(e.KeyChar) || e.KeyChar == Convert.ToChar(Keys.Back))) //숫자와 백스페이스를 제외한 나머지를 바로 처리
|
|
{
|
|
e.Handled = true;
|
|
}
|
|
}
|
|
}
|
|
}
|