* UIEditForm:增加按钮事件

This commit is contained in:
Sunny 2020-07-13 23:55:14 +08:00
parent 72ab4b487e
commit c95d530a83
5 changed files with 29 additions and 6 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -55,6 +55,12 @@ namespace Sunny.UI
max = 0;
}
if ((max - min).IsZero())
{
max = 100;
min = 0;
}
UIChartHelper.CalcDegreeScale(min, max, o.YAxis.SplitNumber,
out int start, out int end, out double interval);

View File

@ -36,6 +36,9 @@ namespace Sunny.UI
public bool IsOK { get; private set; }
public event EventHandler ButtonOkClick;
public event EventHandler ButtonCancelClick;
protected void btnOK_Click(object sender, EventArgs e)
{
if (!CheckData())
@ -43,16 +46,30 @@ namespace Sunny.UI
return;
}
DialogResult = DialogResult.OK;
IsOK = true;
Close();
if (ButtonOkClick != null)
{
ButtonOkClick.Invoke(sender,e);
}
else
{
DialogResult = DialogResult.OK;
IsOK = true;
Close();
}
}
private void btnCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
IsOK = false;
Close();
if (ButtonCancelClick != null)
{
ButtonCancelClick.Invoke(sender,e);
}
else
{
DialogResult = DialogResult.Cancel;
IsOK = false;
Close();
}
}
protected virtual bool CheckData()