Sunday, December 25, 2011

WPF : Setting default focus on a control when window is shown


Here is the trick to set focus on a particular control when windows is started up in WPF. It doesn’t require any code-behind.
Add FocusManager.FocusElement in Window tag as show below and bind it with the element that should receive focus when windows is started up.


No comments:

Post a Comment