Is there a simple way to change the Input box border color on focus and on mouse over without overwriting the entire style.
1 Answer, 1 is accepted
answered on 25 Sep 2014, 03:34 PM
The easiest way to achieve the desired would be to get the borders named MouseOverVisual and FocusVisual from the Template of the control and set their BorderBrush colors. You can do that in the Loaded event handler of the DateTimePicker as shown below:
var mouseOverBorder = picker.Template.FindName("MouseOverVisual", picker) as Border;
mouseOverBorder.BorderBrush = Brushes.Red;
var focusBorder = picker.Template.FindName("FocusVisual", picker) as Border;
focusBorder.BorderBrush = Brushes.Red;
However this won't change the border around the drop down button - you would need to modify its Style in this case.
Hope this help.
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.