SVN-Revision: r877
This commit is contained in:
wyf
2025-07-18 03:33:36 +00:00
parent b1375c708e
commit 2f984aac07
+45 -1
View File
@@ -61,8 +61,33 @@ namespace Lskj.PubAdd
{
SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.Selectable | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true);
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)
{
WaitForm.ShowForm();
@@ -74,6 +99,7 @@ namespace Lskj.PubAdd
this.SysModel = new ModuleModel(MainImpl.GetSystemdllTab(this.Model.ModuleCode));
this.SysModel.ParmaryKey = BaseImpl.GetBasePrimaryKey(this.Model.ModuleCode);
this.ModuleAddControl.OnAddRecordCallBack += OnAddRecordCallBack;
this.ModuleAddControl.OnClearCallBack += OnClearCallBack; ;
this.details = BaseModuleImpl.GetBaseAddTabDetail(Model.ModuleCode);
this.CreateControlLocation();
@@ -544,6 +570,24 @@ namespace Lskj.PubAdd
}
/// <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>
/// <param name="sender"></param>