C# Winform文本框隐藏选择和GotFocus

C# Winform文本框隐藏选择和GotFocus,c#,winforms,textbox,C#,Winforms,Textbox,有人能告诉我为什么以下两种代码有不同的行为吗?第一个代码将调用文本框GotFocus事件,而第二个代码在执行lostfocus后不会调用GotFocus事件。请参考,HideSelection最初设置为false,以在第一时间高亮显示所有文本框 private void textBox_LostFocus(object sender, EventArgs e) { foreach (TextBox item in this.textbox) //got 3 text box,

有人能告诉我为什么以下两种代码有不同的行为吗?第一个代码将调用文本框
GotFocus
事件,而第二个代码在执行
lostfocus
后不会调用
GotFocus
事件。请参考,
HideSelection
最初设置为false,以在第一时间高亮显示所有文本框

private void textBox_LostFocus(object sender, EventArgs e)
{
    foreach (TextBox item in this.textbox)  //got 3 text box,
    {
        if (item.Focused == true)
        {
             item.HideSelection = false;
             item.SelectAll();
        }
        else
             item.HideSelection = true;
}

private void textBox_LostFocus(object sender, EventArgs e)
{
    foreach (TextBox item in this.textbox)  //got 3 text box,
    {                     
        if (item.Focused == true)
        {
            item.HideSelection = true;   //difference here
            item.HideSelection = false;
            item.SelectAll();
        }
        else
            item.HideSelection = true;
}