WPF Text Fields Saved

Is there a way to make the cursor in the text box visible, even if the text box has lost focus?

+3
source share
2 answers

Here is another way. The selection will also be highlighted.

private void MyMethod()
{
    TextBox txt = ...;
    txt.LostFocus += new RoutedEventHandler(staticTextBox_LostFocus);
}

private static void staticTextBox_LostFocus(object sender, RoutedEventArgs e)
{
    e.Handled = true;
}
+2
source

It may not be what you want, but I used it. In fact, you can set FocusManager.IsFocusScope = "True" in your text box so that it always focuses its attention. This means that the carriage will always be visible. You can enable / disable this behavior. FocusManager.IsFocusScope = "True" / "False"

+1
source

Source: https://habr.com/ru/post/1746047/


All Articles