ab56a9bcf7
SVN-Revision: r240
45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
/******************************
|
|
* 说明:BaseUserControl 扩展类
|
|
* 创建人:龚宇超
|
|
* 创建日期:2017-12-15
|
|
* 修改人:
|
|
* 修改日期:
|
|
* 修改备注:
|
|
* 版本:1.0.0.0
|
|
******************************/
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace Lskj.Control.Model
|
|
{
|
|
/// <summary>
|
|
/// BaseUserControl 扩展类
|
|
/// </summary>
|
|
public static class BaseUserControlExtend
|
|
{
|
|
/// <summary>
|
|
/// <para>说明:将Control转换为BaseUserControl</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-12-15 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="control">The control.</param>
|
|
/// <returns>BaseUserControl.</returns>
|
|
public static BaseUserControl ToBaseUserControl(this System.Windows.Forms.Control control)
|
|
{
|
|
if (control == null) return null;
|
|
|
|
control = control.Parent;
|
|
if (control != null && control.Tag == null)
|
|
control = control.Parent;
|
|
|
|
return (control != null && control is BaseUserControl) ? control as BaseUserControl : null;
|
|
}
|
|
}
|
|
}
|