SearchBox.PrepareForFocusOnKeyboardInput SearchBox.PrepareForFocusOnKeyboardInput SearchBox.PrepareForFocusOnKeyboardInput SearchBox.PrepareForFocusOnKeyboardInput Event


Occurs when the FocusOnKeyboardInput property is true and the app receives textual keyboard input.

public : event TypedEventHandler<SearchBox, RoutedEventArgs> PrepareForFocusOnKeyboardInput
// Register
event_token PrepareForFocusOnKeyboardInput(TypedEventHandler<SearchBox, RoutedEventArgs> const& handler) const;

// Revoke with event_token
void PrepareForFocusOnKeyboardInput(event_token const& cookie) const;

// Revoke with event_revoker
PrepareForFocusOnKeyboardInput_revoker PrepareForFocusOnKeyboardInput(auto_revoke_t, TypedEventHandler<SearchBox, RoutedEventArgs> const& handler) const;
public event TypedEventHandler<SearchBox, RoutedEventArgs> PrepareForFocusOnKeyboardInput
Public Event PrepareForFocusOnKeyboardInput As TypedEventHandler (Of SearchBox, RoutedEventArgs)
<SearchBox PrepareForFocusOnKeyboardInput="eventhandler"/>


This event occurs only if the FocusOnKeyboardInput property is true. If you wan to provide "type-to-search" behavior in your app, you should handle this event and synchronously ensure the SearchBox control is visible before the event call completes. After this event occurs, the control sets focus to itself.

When FocusOnKeyboardInput is true, keyboard input on the current thread is intercepted and textual input is redirected to the SearchBox. Only textual input will cause the SearchBox to receive focus. Non-text keys, such as arrows or Tab, are not redirected to the SearchBox. WIN/CTRL/ALT key combinations (except for Ctrl-V for paste) are also not redirected.

See also