且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在(wpf)中获取新窗口事件

更新时间:2023-11-03 17:15:52

Wpf

 <WebBrowser Navigating="Webbrozer1_Navigating"  Name="Webbrozer1" VerticalAlignment="Top"

Source =" textbr"的Horizo​​ntalAlignment = QUOT;拉伸&QUOT;&NBSP;高度= QUOT; 535&QUOT;&NBSP; &NBSP; /&GT;&NBSP; &NBSP; &NBSP;

Source="textbr" HorizontalAlignment="Stretch"  Height="535"   />     

< Button Width =" 120"高度= QUOT; 40&QUOT;&NBSP;的Horizo​​ntalAlignment = QUOT;左&QUOT; VerticalAlignment = QUOT;底座&QUOT;

<Button Width="120" Height="40"  HorizontalAlignment="Left" VerticalAlignment="Bottom"

内容= QUOT; NewWindows&QUOT;点击=" Button_Click_1" />

Content="NewWindows" Click="Button_Click_1"/>

代码

      private void Button_Click_1(object sender, RoutedEventArgs e)        
{                  
dynamic _f =   Webbrozer1.InvokeScript("


find",new object [] {" ctl00_PlaceHolderMain_rvGetProceedingScreen"}); 

_fexportReport(" Excel");  &NBSP;
}
find", new object[] { "ctl00_PlaceHolderMain_rvGetProceedingScreen" });  _fexportReport("Excel");    }

 此代码打开一个新窗口下载Excel文件。

我想访问新窗口事件到处理链接并取消

 This code to open a new window to download the Excel file.
I want access to new window event to deal with link and cancel