Tom Leunttjens

I've adde the KeyUP event listener to my root canvas. When i set focus manually (mouseclick inside canvas) I can catch the keyup event but how can you set the focus to the canvas when it loads (javascript or xaml)

Thx
Tom


Re: Silverlight (formerly WPF/E) Developer Issues HOWTO : WPF/E Set focus to control

Mark Rideout


There isn't any method that WPF/E exposes for this. The best you can do (not sure if it will work on all browsers) is to call the focus() method on the div tag/plugin that is the control:


document.getElementById("wpfeControlName").focus();

-mark
Program Manager
Microsoft
This post is provided "as-is"





Re: Silverlight (formerly WPF/E) Developer Issues HOWTO : WPF/E Set focus to control

Tom Leunttjens

i've had no luck setting focus() on the div tag ... (in the Cavans Loaded event)
tried with IE7 & firefox.

I think if there was a solution the wpf/e piano demo would have done the same thing.