简体   繁体   中英

How to open a new window in browser with focus

I would like to know how to open new window in the browser with focus while keeping the other window open too.

I have a button in my silverlight app that must open a pdf in another window or tab, i want the new window to have focus while keeping the initial page open.

I can get the new window to open but without focus or i can get it to replace the current page , then returning to the app requires login etc.

So i need 3 things... 1)open new window 2)focus new window 3)leave old window open

Uri myUri = new Uri(@"http://......./ViewPDF.aspx");
HtmlPage.Window.Navigate(myUri, "_newWindow");

HtmlPage.Window.Navigate(myUri);
HtmlPage.Window.Eval("window.focs()")
HtmlPage.PopupWindow(myUri, "_blank", null);

None of these meet all 3 requirements.

please help..

Thanking you in advance

HtmlPopupWindowOptions options = new HtmlPopupWindowOptions();

        options.Left = 300;
        options.Top = 150;
        options.Width = 1024;
        options.Height = 768;
        options.Directories = false;
        options.Location = false;
        options.Menubar = false;
        options.Status = false;
        options.Toolbar = false;

Uri myUri = new Uri(@"http://......./ViewPDF.aspx");

HtmlPage.PopupWindow(Uri, "_blank", options);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM