* UIEditForm:增加按钮事件
This commit is contained in:
parent
72ab4b487e
commit
c95d530a83
BIN
Bin/SunnyUI.dll
BIN
Bin/SunnyUI.dll
Binary file not shown.
BIN
Bin/SunnyUI.pdb
BIN
Bin/SunnyUI.pdb
Binary file not shown.
Binary file not shown.
@ -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);
|
||||
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user