출처 : https://stackoverflow.com/questions/15239946/popup-window-webbrowser-control
DLL 추가
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
// this assumes that you've added an instance of WebBrowser and named it webBrowser to your form
SHDocVw.WebBrowser_V1 axBrowser = (SHDocVw.WebBrowser_V1)webBrowser.ActiveXInstance;
// listen for new windows
axBrowser.NewWindow += axBrowser_NewWindow;
}
void axBrowser_NewWindow(string URL, int Flags, string TargetFrameName, ref object PostData, string Headers, ref bool Processed)
{
// cancel the PopUp event
Processed = true;
// send the popup URL to the WebBrowser control
webBrowser.Navigate(URL);
}
}
'C#' 카테고리의 다른 글
app.config에서 연결 문자열 암호화 (0) | 2020.07.21 |
---|---|
[c#] Get Client IP address using WCF (0) | 2019.12.17 |
[c#] Start a new process and Killing the current process (A프로그렘에서 B띄우기) (0) | 2017.07.18 |
[C#] C# WebBrowser version 변경 (0) | 2017.07.04 |
[c#] Dataset 압축(Dataset Compress) (0) | 2017.03.02 |