[英]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. 我的silverlight应用程序中有一个按钮,必须在另一个窗口或选项卡中打开pdf,我希望新窗口在保持初始页面打开的同时具有焦点。
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 所以我需要3件事...... 1)打开新窗口2)关注新窗口3)打开旧窗口
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. 这些都不符合所有3个要求。
please help.. 请帮忙..
Thanking you in advance 提前感谢你
HtmlPopupWindowOptions options = new HtmlPopupWindowOptions(); 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"); Uri myUri = new Uri(@“http://......./ViewPDF.aspx”);
HtmlPage.PopupWindow(Uri, "_blank", options); HtmlPage.PopupWindow(Uri,“_ blank”,选项);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.