Did you get the Silverlight focus? I failed.

Source: Internet
Author: User

In the form (or custom control) loaded event, focus () is set for an internal editable control,ProgramAfter running, the control should be focused.

There is no problem in testing in IE, but it fails in chrome. After looking at some examples, I found that there are two ways to solve the problem:

1. Add the following content to a proper location (such as the loaded event ):CodeHtmlpage. plugin. Focus (); 2. Add JavaScript code control in the file carrying the SL plug-in to get the focus;

Write a JavaScript method for calling

 
FunctionAppload (sender, argS ){
VaRXamlobject = Document. getelementbyid ('silverlightcontrol ');
If(Xamlobject! =Null)
Xamlobject. Focus ();
}

Add the ID attribute id = "silverlightcontrol" to the object node"

Add Param <Param name = "onLoad" value = "appload"/>

Certificate ----------------------------------------------------------------------------------------------------------------------------------------------

In fact, the principles of the two methods are the same, except that the former is processed on the server and the latter is processed on the frontend. Unfortunately, neither of the two methods has been successfully tested. Sometimes I will continue the test and record the test results.

(When It Comes To browser compatibility, it's a big deal. You can see it again !)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.