'Declaration
Public Event DropFile As GdViewer.DropFileEventHandler
public event GdViewer.DropFileEventHandler DropFile
public event DropFile: GdViewer.DropFileEventHandler;
In JScript, you can handle the events defined by another class, but you cannot define your own.
public: __event GdViewer.DropFileEventHandler* DropFile
public: event GdViewer.DropFileEventHandler^ DropFile
Event Data
The event handler receives an argument of type GdViewer.DropFileEventArgs containing data related to this event. The following GdViewer.DropFileEventArgs properties provide information specific to this event.
Property | Description |
---|---|
File | The array of file paths of the files that are dropped in the control. |
Handled | (Inherited from System.Windows.RoutedEventArgs) |
OriginalSource | (Inherited from System.Windows.RoutedEventArgs) |
RoutedEvent | (Inherited from System.Windows.RoutedEventArgs) |
Source | (Inherited from System.Windows.RoutedEventArgs) |
Remarks
Please ensure that you have enabled the AllowDropFile property to benefit from using this event.
Example
How to utilize this event in your GdViewer control.
'We assume that the GdViewer1 control has been properly integrated 'and the DropFile event has been properly added. 'Define the event. Sub GdViewer1_DropFile(ByVal sender As Object, ByVal e As GdPicture14.WPF.GdViewer.DropFileEventArgs) If e.File.Length > 0 Then If GdViewer1.DisplayFromFile(e.File(0)) <> GdPictureStatus.OK Then MessageBox.Show("The file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.DropFile") End If End If End Sub
//We assume that the GdViewer1 control has been properly integrated //and the DropFile event has been properly added. //Define the event. void GdViewer1_DropFile(object sender, GdPicture14.WPF.GdViewer.DropFileEventArgs e) { if (e.File.Length > 0) { if (GdViewer1.DisplayFromFile(e.File[0]) != GdPictureStatus.OK) MessageBox.Show("The file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.DropFile"); } }
See Also