Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
Draw a "focusVisual" (Rectangle) only when control receives focus via keyboard, not when 'via mouse'
Nishant Rana
Nov 1 2010 5:44 AM
12.6k
Reply
The problem is that I have a control which has some embedded elements within, i.e. textbox, textblock etc. For this control i I want to implement my custom "FocusVisualStyle" that just encapsulate "TextBox" not entire control. To do that i've placed triggers on "IsKeyboardFocused" property to shape my "FocusVisual" (Rectangle) just around textbox.
Everything goes well except one :-( I want FocusVisual to appear only when we got a focus via keyboard (that is what "IsKeyboardFocused" suppose to do and thats how a FocusVisual should work) but I can see the FocusVisual appear even by mouse clicking on my TextBox.
There are few workarounds, like one : handle "
GotKeyboardFocus" but i guess its not really a smart approach.
Is anyone has any idea why "IsKeyboardFocused" absorbing "IsMouseCaptured" event ?
Thanks and Regards
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
Translate complete application in diffrent language
WPF Slider control Delay issue??