Note that there are some explanatory texts on larger screens.

plurals
  1. POThe difference between GotFocus and GotKeyboardFocus
    primarykey
    data
    text
    <p>What is the difference(s) between <code>GotFocus</code> and <code>GotKeyboardFocus</code> -and similarly <code>LostFocus</code> and <code>LostKeyboardFocus</code>? </p> <p>Sorry for the simple question, but, I googled it and read a lot of blog posts, but I'm still confused. It seems nobody knows exactly what is the difference ):</p> <p><strong>UPDATE:</strong></p> <p>My usage:</p> <p>I am creating a custom control by extending <code>Control</code> class. Something like <code>ComboBox</code> but with some other effects. I'm trying to open and close a <code>Popup</code> by setting a property: <code>IsDropDownOpen</code> just like a <code>ComboBox</code> through the <code>GotFocus</code> and <code>LostFocus</code> events. I don't want to <code>Popup</code> get closed, when I <code>Alt+Tab</code>ed the windows, but get closed when I click on a <code>Button</code> for example or I go to a <code>TextBox</code>. I did:</p> <pre><code>private static void OnGotFocusHandler(object sender, RoutedEventArgs e) { if (e.Handled) return; ((SearchBox)sender).IsDropDownOpen = true; e.Handled = true; } private static void OnLostFocusHandler(object sender, RoutedEventArgs e) { if (e.Handled) return; ((SearchBox)sender).IsDropDownOpen = false; e.Handled = true; } </code></pre> <p>The <code>GotFocus</code> works. But the <code>Lost</code> one didn't. If I do the <code>Lost</code> stuff in <code>LostKeyboardFocus</code> then when I <code>Alt+Tab</code> the windows, or <code>Window</code> goes to inactive, then the method get called, while I don't want. How can I solve it? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload