Stop ScrollView from setting focus on EditText

This works. Not sure if it’s the best solution or not. // SCROLL VIEW HACK // BOGUS ScrollView view = (ScrollView)findViewById(R.id.scrollView); view.setDescendantFocusability(ViewGroup.FOCUS_BEFORE_DESCENDANTS); view.setFocusable(true); view.setFocusableInTouchMode(true); view.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { v.requestFocusFromTouch(); return false; } });

Tkinter main window focus

If focus_force() is not working you can try doing: window.after(1, lambda: window.focus_force()) It’s essentially the same thing, just written differently. I just tested it on python 2.7. root.focus_force() wouldn’t work but the above method did.

Set the focus on a textbox in xaml wpf

You can use the FocusManager.FocusedElement attached property for this purpose. Here’s a piece of code that set the focus to TxtB by default. <StackPanel Orientation=”Vertical” FocusManager.FocusedElement=”{Binding ElementName=TxtB}”> <TextBox x:Name=”TxtA” Text=”A” /> <TextBox x:Name=”TxtB” Text=”B” /> </StackPanel> You can also use TxtB.Focus() in your code-behind if you don’t want to do this in XAML.

How to change listview selected row backcolor even when focus on another control?

What you describe works exactly as expected, assuming that you’ve set the HideSelection property of the ListView control to False. Here’s a screenshot for demonstration purposes. I created a blank project, added a ListView control and a TextBox control to a form, added some sample items to the ListView, set its view to “Details” (although … Read more