Home > Net >  CefSharp WinForm ChromiumWebBrowser under the click event is not triggered
CefSharp WinForm ChromiumWebBrowser under the click event is not triggered

Time:09-28

Public _click ()
{
InitializeComponent ();
String path=ConfigurationManager. AppSettings [r]. "path" ToString ()==""? "Https://www.baidu.com/" : ConfigurationManager AppSettings [r]. "path" ToString ();
Cef. The Initialize (new CefSettings ());
ChromiumWebBrowser browser=new ChromiumWebBrowser (path) {Dock=DockStyle. The Fill};
This. Controls. The Add (browser);
The Focus ();
The DownloadHandler=new DownloadHandler ();
The MenuHandler=new MenuHandler ();
The FocusHandler=new FocusHandler ();
Browser. Click +=browser_Click;
The Dock=DockStyle. The Fill;


}
Private void browser_Click (object sender, EventArgs e)
{
Throw new NotImplementedException ();
}

Clikc not trigger events, god solve too

CodePudding user response:

I also met, the original poster to how to solve??

CodePudding user response:

I also met, blogger is how to solve

CodePudding user response:

CefSharp blocked ChromiumWebBrowser mouse bubbling events, if you want to capture the mouse events in cs code, need to be defined in the interception, the specific methods refer to the following link:
https://github.com/cefsharp/CefSharp/issues/1098
https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-lbuttondblclk
  •  Tags:  
  • C#
  • Related