DHDHSoftware/DHSoftware/Views/AddMotionControl.cs

50 lines
1.3 KiB
C#
Raw Normal View History

2025-03-18 14:19:33 +08:00

namespace DHSoftware.Views
{
public partial class AddMotionControl : UserControl
{
private AntdUI.Window window;
public bool submit;
public string MotionName;
public string MotionType;
2025-03-21 08:51:20 +08:00
public AddMotionControl(AntdUI.Window _window,string TitleName)
2025-03-18 14:19:33 +08:00
{
this.window = _window;
InitializeComponent();
2025-03-21 08:51:20 +08:00
lbTitleName.Text = TitleName;
2025-03-18 14:19:33 +08:00
// 绑定事件
BindEventHandler();
}
private void BindEventHandler()
{
button_ok.Click += Button_ok_Click;
button_cancel.Click += Button_cancel_Click;
}
private void Button_cancel_Click(object sender, EventArgs e)
{
submit = false;
this.Dispose();
}
private void Button_ok_Click(object sender, EventArgs e)
{
input_name.Status = AntdUI.TType.None;
//检查输入内容
if (String.IsNullOrEmpty(input_name.Text))
{
input_name.Status = AntdUI.TType.Error;
AntdUI.Message.warn(window, "运动控制名称不能为空!", autoClose: 3);
return;
}
MotionName = input_name.Text;
submit = true;
this.Dispose();
}
}
}