using System;
|
using System.Windows.Forms;
|
|
namespace AStation.WinFrmUI.Chart
|
{
|
public partial class InputXYDialog : DevExpress.XtraEditors.XtraForm
|
{
|
public InputXYDialog()
|
{
|
InitializeComponent();
|
}
|
|
public void SetLabelX(string caption)
|
{
|
this.itemX.Text = caption;
|
}
|
|
public void SetLabelY(string caption)
|
{
|
this.itemY.Text = caption;
|
}
|
|
public double Y = 0, X = 0;
|
private bool Valid()
|
{
|
this.dxErrorProvider1.ClearErrors();
|
if (string.IsNullOrEmpty(this.txtX.Text))
|
{
|
this.dxErrorProvider1.SetError(this.txtX, "必填项");
|
return false;
|
}
|
if (string.IsNullOrEmpty(this.txtY.Text))
|
{
|
this.dxErrorProvider1.SetError(this.txtY, "必填项");
|
return false;
|
}
|
return true;
|
}
|
|
private void btnOK_Click(object sender, EventArgs e)
|
{
|
if (!Valid())
|
return;
|
|
X = Convert.ToDouble(this.txtX.Text.Trim());
|
Y = Convert.ToDouble(this.txtY.Text.Trim());
|
|
|
DialogResult = DialogResult.OK;
|
this.Close();
|
}
|
}
|
}
|