geboshi_V1/LeatherProject/LeatherApp/Page/GetHeightFrm.cs

69 lines
1.8 KiB
C#
Raw Normal View History

2024-12-18 10:44:17 +08:00
using Models;
using Sunny.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 LeatherApp.Page
{
public partial class GetHeightFrm : UIEditForm
{
public Thickness Thickness { get; set; }
public GetHeightFrm(double yDis)
{
InitializeComponent();
numYDis.Text = yDis.ToString();
numHeight1.Select();
numHeight1.Focus();
2024-12-18 10:44:17 +08:00
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.Close();
}
private void btnOK_Click(object sender, EventArgs e)
{
Thickness = new Thickness();
Thickness.Y_Dis = double.Parse(numYDis.Text) * 100; //cm
Thickness.Value1 = double.Parse(numHeight1.Text);
Thickness.Value2 = double.Parse(numHeight2.Text);
Thickness.Value3 = double.Parse(numHeight3.Text);
this.Close();
}
private void numHeight1_KeyDown(object sender, KeyEventArgs e)
{
if(e.KeyCode == Keys.Enter)
{
numHeight2.Select();
numHeight2.Focus();
}
}
private void numHeight2_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
numHeight3.Select();
numHeight3.Focus();
}
}
private void numHeight3_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
btnOK.Select();
btnOK.Focus();
}
}
2024-12-18 10:44:17 +08:00
}
}