CS开发框架禁用主窗体Toolbar的按钮
CS开发框架禁用主窗体Toolbar的按钮
重写frmBaseDataForm窗体的ButtonStateChanged方法即可,参考下面的代码:
扫一扫加作者微信
重写frmBaseDataForm窗体的ButtonStateChanged方法即可,参考下面的代码:
protected override void ButtonStateChanged(UpdateType currentState)
{
base.ButtonStateChanged(currentState);
//新增或修改状态
bool accessable = currentState == UpdateType.Add || currentState == UpdateType.Modify;
//跟据状态禁用输入框
base.SetDetailEditorsAccessable(gcDetailEditor, accessable);
//禁用数据操作按钮
_buttons.GetButtonByName("btnView").Enable = false;
_buttons.GetButtonByName("btnAdd").Enable = false;
_buttons.GetButtonByName("btnDelete").Enable = false;
_buttons.GetButtonByName("btnPrint").Enable = false;
_buttons.GetButtonByName("btnPreview").Enable = false;
}
// 来源:www.CSFramework.com, C/S框架网
{
base.ButtonStateChanged(currentState);
//新增或修改状态
bool accessable = currentState == UpdateType.Add || currentState == UpdateType.Modify;
//跟据状态禁用输入框
base.SetDetailEditorsAccessable(gcDetailEditor, accessable);
//禁用数据操作按钮
_buttons.GetButtonByName("btnView").Enable = false;
_buttons.GetButtonByName("btnAdd").Enable = false;
_buttons.GetButtonByName("btnDelete").Enable = false;
_buttons.GetButtonByName("btnPrint").Enable = false;
_buttons.GetButtonByName("btnPreview").Enable = false;
}
// 来源:www.CSFramework.com, C/S框架网
扫一扫加作者微信
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网