Is it possible to click a Button without ever losing focus on a TextBox? Is it possible to click a Button without ever losing focus on a TextBox? wpf wpf

Is it possible to click a Button without ever losing focus on a TextBox?


Set Focusable="False" on the Button. You will still be able to click it with the mouse, and it will still call your click event handler, but it won't acquire focus or cause the TextBox to lose focus.


An alternative is to use a PictureBox instead o a Button, then you would customize it. PictureBoxes don't lose focus when clicked.