Delphi:Vcl Styles&Drag-n-Drop

Ali*_*end 1 delphi drag-and-drop delphi-xe2 vcl-styles

我是德尔福程序员,我有一个问题.我使用TStyleManager创建一个表单,并在我的应用程序上使用外观.但我也想在我的应用程序中使用Drag-n-Drop文件.我怎么能意识到这一点?我尝试了很多方法,但是......我无法做到.希望对你有所帮助

RRU*_*RUZ 5

当您更改vcl样式时,将重新创建窗体的句柄,因此,如果DragAcceptFiles在设置样式之前调用该 函数,则在应用样式时使用的句柄将不同.要修复它以这种方式执行DragAcceptFiles函数.

 TStyleManager.SetStyle(StyleName);
 Application.ProcessMessages;//process the message queue;
 DragAcceptFiles( Handle, True );
Run Code Online (Sandbox Code Playgroud)