标签:eve object sha text and event reac nta foreach
#region-----画面のテキストボックスの全選択処理-----
/// <summary>
/// 画面のテキストボックスの全選択処理
/// </summary>
/// <param name="crol"></param>
public static void TextBoxEnter_SelectAll(Control crol)
{
System.Windows.Forms.TextBox txtBox = new System.Windows.Forms.TextBox();
foreach (Control con in crol.Controls)
{
if (con is System.Windows.Forms.TextBox)
{
txtBox = (System.Windows.Forms.TextBox)con;
txtBox.Enter += (EventHandler)delegate(object sender, EventArgs e)
{
((TextBox)sender).SelectAll();
};
}
if (con.Controls.Count > 0)
{
TextBoxEnter_SelectAll(con);
}
}
}
#endregion
标签:eve object sha text and event reac nta foreach
原文地址:https://www.cnblogs.com/-jwj/p/11760884.html