tags:

views:

25

answers:

3

The Find and Replace dialog in Visual Studio is a perfect example of what im trying to accomplish. Notice how the "Find what" text field has keyboard focus but the "Find Next" button appears bluish as if it has keyboard focus also even though it does not.

alt text

How can I accomplish this myself? I've tried messing with FocusManager and Focus Scopes without much luck. I suspect i may be barking up the wrong tree? Any advice is appreciated!

Thanks

A: 

I think you need to change the Button's control template. Check the buttons default template. You should find the corresponding style when the button has focus. Then change it so that even if there's no focus the style is still applied.

John
A: 

One way you could accomplish this is by putting a rectangle over the button, disabling its hit testing and giving it a brush to create the desired highlight effect. Basically you're indicating that the button is the default choice if you press Enter, which I don't think is the same as the button actually having focus.

Dan Bryant
+3  A: 

I just realized all i needed to do was set IsDefault="True" for the button. Duh!

Bret
This will execute the Find Next button's click event if you press enter. Is this what you want to accomplish?
John