using Autodesk.Revit.UI; 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 FormCoilOutAir2 : Form { public FormCoilOutAir2() { InitializeComponent(); } private int _OutAirCoilCnt; public int OutAirCoilCnt { get { return _OutAirCoilCnt; } set { _OutAirCoilCnt = value; } } private void FormCoilOutAir2_Load(object sender, EventArgs e) { this.KeyPreview = true; txt_OutAirCoilCnt2.Text = OutAirCoilCnt.ToString(); } private void txt_OutAirCoilCnt2_TextChanged(object sender, EventArgs e) { if (txt_OutAirCoilCnt2.Text == "") return; int inputValue = int.Parse(txt_OutAirCoilCnt2.Text); OutAirCoilCnt = int.Parse(txt_OutAirCoilCnt2.Text); } private void txt_OutAirCoilCnt2_KeyPress(object sender, KeyPressEventArgs e) { //숫자만 입력되도록 필터링 if (!(char.IsDigit(e.KeyChar) || e.KeyChar == Convert.ToChar(Keys.Back))) //숫자와 백스페이스를 제외한 나머지를 바로 처리 { e.Handled = true; } } private void FormCoilOutAir2_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; } } } }