Einzelnen Beitrag anzeigen

Benutzerbild von dummzeuch
dummzeuch

Registriert seit: 11. Aug 2012
Ort: Essen
1.468 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#10

AW: Drag & Drop vom Explorer auf unterschiedliche Steuerelemente

  Alt 8. Nov 2016, 19:04
Vielleicht auch eine Moeglichkeit:

Delphi-Quellcode:
///<summary>
/// Enables dropping of files (folders) from explorer to the given WinControl
/// @param WinCtrl is a TWinControl for which dropping should be enabled
/// @param Callback is a TOnFilesDropped event that is called when files are dropped on the control.
/// @returns the TDropFilesActivator instance created.
/// NOTE: You do not need to free this object! It will automatically be freed when the
/// TWinControl is destroyed. </summary>
function TWinControl_ActivateDropFiles(_WinCtrl: TWinControl; _Callback: TOnFilesDropped): TObject;
Fuer jedes Control wird exact ein Aufruf dieser Funktion benoetigt, und natuerlich ein Callback, der aufgerufen werden soll, wenn der User eine Datei auf das Control dropt. Der Rest passiert automatisch.

https://sourceforge.net/p/dzlib/code...Utils.pas#l936
Thomas Mueller
  Mit Zitat antworten Zitat