Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
VCL
8-Byte Alignment
Action Classes
Additional Controls
Core VCL Classes
DFM to TEXT
Dialog Controls
Docking
Drag/Drop
Emulation Classes
Exceptions
Gestures
Graphics
MAPI Support
MDI Support
Multi-Monitor Support
OnGesture event
Printing
Property/Type Editors
Registry / INI Objects
Ribbon Controls
Sample Controls
Services
Standard Controls
Styles
Control Hooks
Designer
Other
Style Files
TCustomStyle
TCustomStyleServices
TStyleEngine
TStyleManager
TUxThemeStyle
System Controls
Thread support
Touch Controls
Type Info
Win 3.1 Controls
Win 32 Controls
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/VCL/Styles
[ Add a report in this area ]
Report #:
105612
Status:
Closed
TrySetStyle() will strip/remove any setting to DragAcceptFiles()
Project:
Delphi
Build #:
16.0.4429.46931
Version:
16.4
Submitted By:
Dag Ringdal
Report Type:
Issue
Date Reported:
5/15/2012 1:36:10 AM
Severity:
Extreme corner case
Last Updated:
5/15/2012 7:24:30 PM
Platform:
All versions
Internal Tracking #:
Resolution:
Test Case Error
(Resolution Comments)
Resolved in Build:
:
None
Duplicate of:
None
Voting and Rating
Overall Rating:
No Ratings Yet
0.00 out of 5
Total Votes:
None
Description
VCL failure:
Any call to TStyleManager.TrySetStyle('Aqua Light Slate');
- or other styles - will remove the working dragdrop functionality. The form will no longer accept drop.
Not possible to re-establish the functionality by a new call to DragAcceptFiles(Handle, true);
Steps to Reproduce:
1. Create a form,
2. Add OnCreate event handler for TForm as below.
--------
uses ShellApi;
procedure TForm1.FormCreate(Sender: TObject);
begin
DragAcceptFiles(Handle, True);
end;
--------
3. Creating a private procedure to handle drop of files from windows explorer etc as below.
-------
...
private
procedure WMDropFiles(var Msg : TWMDROPFILES); message WM_DROPFILES;
...
...
procedure TForm1.WMDropFiles(var Msg: TWMDROPFILES);
begin
ShowMessage('WMDropFiles');
end;
-------
4. Working as it should
5. however, if I add custom sytles(e.g., Carbon, Aqua Light Slate etc...) and TButton and its OnClick event handler as below
-------
uses ..., Vcl.Themes;
procedure TForm1.Button1Click(Sender: TObject);
begin
TStyleManager.TrySetStyle('Aqua Light Slate');
end;
-------
any call to TStyleManager.TrySetStyle('Aqua Light Slate');
- or any other style - will remove the dragdrop functionality.
Workarounds
None known
Attachment
None
Comments
Tomohiro Takahashi at 5/15/2012 7:19:26 PM
-
> TForm.OnCreate -> DragAcceptFiles(Handle, true);
I think that after changing Style, form has been re-created and the Handle can not be used.
So, you need to call DragAcceptFiles(Handle, True); again at some timing...
Tomohiro Takahashi at 5/15/2012 7:23:51 PM
-
Please try to override
procedure CreateWindowHandle(const Params: TCreateParams); override;
and, call DragAcceptFiles again as below.
------------------
...
type
TForm1 = class(TForm)
...
protected
procedure CreateWindowHandle(const Params: TCreateParams); override;
public
end;
...
...
procedure TForm1.CreateWindowHandle(const Params: TCreateParams);
begin
inherited;
DragAcceptFiles(Handle, True);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
TStyleManager.TrySetStyle('Aqua Light Slate');
end;
------------------
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us