开发者

Handling GotFocus when using BringIntoView in WPF

I am scrolling to different items in a control, and using .BringIntoView(Rect) rather than .Focus(), so I can buffer the size around the control, so when I focus on something, its not just at the very top or bottom of the main control.

When calling Focus, one can catch GotFocus() to then fire an event when the control has received focus. But this does not fire when using BringIntoView().

I would like to know when a control received focus so I can highlight it to the user so they know where their content went. Is there any way to when control.BringIntoView has completed so I can the开发者_如何学编程n do something to notify the user?


That is because BringIntoView does not activate focus on the control.

Simply call the Focus method on your control reference as well as calling BringIntoView.

Hope that helps.


Create your custom event and raises that event when you call BringIntoView.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜