Skip to main content

Microsoft Silverlight

Mouse not working?RSS Feed

(0)

jerrylmacdonald
jerrylma...

Member

Member

3 points

14 Posts

Mouse not working?

I coded a 3rd party tutorial where I drag an elipse around that magnifies a streaming video.  It worked fine for me, but when I asked my coworkers to try it, it wouldn't capture any mouse events.  Has anyone else run into this or something similar?

y_makram
y_makram

Contributor

Contributor

6174 points

1,234 Posts

Re: Mouse not working?

Are you sure that the plug in has been activated. In IE if the plug-in does not have the focus, it will not get events, and there is a message like "Click here to activate". You can work around this by setting focus by Javascript. 

Thanks
Yasser Makram
http://www.silverlightrecipes.com
_____
Dont forget to click "Mark as Answer" on the post that helped you. If your question has not been answered, please post a followup question.

jerrylmacdonald
jerrylma...

Member

Member

3 points

14 Posts

Re: Mouse not working?

It did not give any prompts for activation, but it does show the behavior of an object that doesn't have focus.  I will take a look and see if I can't default focus to the Silverlight object. 

y_makram
y_makram

Contributor

Contributor

6174 points

1,234 Posts

Re: Mouse not working?

You can achieve this by adding this line of code to the body onLoad event of the host page

<body onload="document.getElementById('SilverlightControl').focus()">

 
 SilverlightControl is the ID of the control set by the createObjectEx method

Thanks
Yasser Makram
http://www.silverlightrecipes.com
_____
Dont forget to click "Mark as Answer" on the post that helped you. If your question has not been answered, please post a followup question.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities