SVN r877
SVN-Revision: r877
This commit is contained in:
@@ -61,8 +61,33 @@ namespace Lskj.PubAdd
|
|||||||
{
|
{
|
||||||
SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.Selectable | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true);
|
SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.Selectable | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true);
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
this.Activated += OnFrmMainActivated;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 窗体激活时
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void OnFrmMainActivated(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
//新增时输入焦点
|
||||||
|
if (string.IsNullOrEmpty(this.ModuleAddControl.PrimaryValue))
|
||||||
|
{
|
||||||
|
ControlModel controlModel = ModuleAddControl.ControlObj.ControlModels.Where(n => n.Location.X != 0 || n.Location.Y != 0).OrderBy(n => n.TabOrder).FirstOrDefault();
|
||||||
|
if (controlModel != null)
|
||||||
|
{
|
||||||
|
BaseUserControl baseControl = ModuleAddControl.ControlObj.FindControl(controlModel);
|
||||||
|
if (baseControl != null)
|
||||||
|
{
|
||||||
|
baseControl.Focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 窗体加载时
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e"></param>
|
||||||
protected override void OnLoad(EventArgs e)
|
protected override void OnLoad(EventArgs e)
|
||||||
{
|
{
|
||||||
WaitForm.ShowForm();
|
WaitForm.ShowForm();
|
||||||
@@ -74,6 +99,7 @@ namespace Lskj.PubAdd
|
|||||||
this.SysModel = new ModuleModel(MainImpl.GetSystemdllTab(this.Model.ModuleCode));
|
this.SysModel = new ModuleModel(MainImpl.GetSystemdllTab(this.Model.ModuleCode));
|
||||||
this.SysModel.ParmaryKey = BaseImpl.GetBasePrimaryKey(this.Model.ModuleCode);
|
this.SysModel.ParmaryKey = BaseImpl.GetBasePrimaryKey(this.Model.ModuleCode);
|
||||||
this.ModuleAddControl.OnAddRecordCallBack += OnAddRecordCallBack;
|
this.ModuleAddControl.OnAddRecordCallBack += OnAddRecordCallBack;
|
||||||
|
this.ModuleAddControl.OnClearCallBack += OnClearCallBack; ;
|
||||||
this.details = BaseModuleImpl.GetBaseAddTabDetail(Model.ModuleCode);
|
this.details = BaseModuleImpl.GetBaseAddTabDetail(Model.ModuleCode);
|
||||||
|
|
||||||
this.CreateControlLocation();
|
this.CreateControlLocation();
|
||||||
@@ -544,6 +570,24 @@ namespace Lskj.PubAdd
|
|||||||
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 清理后回调
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void OnClearCallBack(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
//新增时输入焦点
|
||||||
|
ControlModel controlModel = ModuleAddControl.ControlObj.ControlModels.Where(n => n.Location.X != 0 || n.Location.Y != 0).OrderBy(n => n.TabOrder).FirstOrDefault();
|
||||||
|
if (controlModel != null)
|
||||||
|
{
|
||||||
|
BaseUserControl baseControl = ModuleAddControl.ControlObj.FindControl(controlModel);
|
||||||
|
if (baseControl != null)
|
||||||
|
{
|
||||||
|
baseControl.Focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
/// 添加保存成功后执行
|
/// 添加保存成功后执行
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender"></param>
|
/// <param name="sender"></param>
|
||||||
|
|||||||
Reference in New Issue
Block a user