Reputation: 8506
How to focus an image in Silverlight?
For example: imagine that when my page loads, It will focus on a texbox, so I don't have to click in there to control. I want the same with image control.
Upvotes: 1
Views: 587
Reputation: 5018
It sounds like you want to make a button of the image and than set the button with the default focus.
Upvotes: 1
Reputation: 14473
There is no way for an Image to acquire input focus directly.
Input focus is supported only on Control
s and its descendants which have the properties IsEnabled
and IsTabStop
set to true
. Image is derived from FrameworkElement
, not from Control
, so it's not technically a control.
You could create a UserControl
that contains the image and then call .Focus()
on the container control.
Upvotes: 3