如何从WebBrowser DragOver事件获取对象?

时间:2019-08-01 17:04:31

标签: c# c++ .net winforms webbrowser-control

我必须从DragDrop操作中获取一个对象,我在WebBrowser中有一个Panel,但是即使将AllowWebBrowserDrop设置为false,我也无法获得{{ 1}}的DragDrop事件,因此我被迫使用Panel DragOver事件,它实际上是其WebBrowser的{​​{1}}事件。

这是我从Body DragDrop事件获取对象的方式:

Document

我想知道如何通过Panel DragOver事件来做到这一点,例如:

private: System::Void Panel_DragDrop(System::Object^ sender, System::Windows::Forms::DragEventArgs^ e) {
    System::Windows::Forms::Button^ button = (System::Windows::Forms::Button^) e->Data->GetData(System::Windows::Forms::Button::typeid);
}

感谢您提供的任何帮助。欢迎使用C ++或C#解决方法。

0 个答案:

没有答案