How to set keyboard focus to a TextBox in Powershell

后端 未结 5 1305
醉梦人生
醉梦人生 2021-01-20 17:34

I\'m looking to find out how to automatically set the keyboard focus to a text box in powershell.

I have a script that asks the user to select an option from a drop

5条回答
  •  不思量自难忘°
    2021-01-20 17:53

    The code that works with the original post and FOCUS is:

    if ( $objTextBox.CanFocus )
    {
    $objTextBox.Focus()
    }
    else
    {
    $objTextBox.Select()
    }
    

提交回复
热议问题