Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
on form drag and drop file option
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
GTK3 still alpha
by
rca
[
Today
at 03:06:56 am]
Force parameters of my ap...
by
TRon
[
Today
at 03:02:47 am]
Pasettimino - Ethernet co...
by
avra
[
Today
at 02:54:29 am]
Scrolling the form.
by
OC DelGuy
[
Today
at 02:48:17 am]
raylib and addons
by
Guva
[
Today
at 02:11:58 am]
Remote access to database...
by
duralast
[
Today
at 12:29:27 am]
New 2D StarField
by
Gigatron
[March 18, 2025, 11:19:00 pm]
NIL vs. Assign: when to u...
by
440bx
[March 18, 2025, 10:07:02 pm]
New version of BGRABitmap
by
sstvmaster
[March 18, 2025, 09:13:12 pm]
Sets Vs Arrays. When to ...
by
440bx
[March 18, 2025, 08:57:02 pm]
efficiency problem
by
PascalDragon
[March 18, 2025, 08:48:11 pm]
Connection to MySQL versi...
by
iginfo
[March 18, 2025, 08:32:32 pm]
Internal error
by
PascalDragon
[March 18, 2025, 08:24:30 pm]
Pagecontrol - Tabsheet ca...
by
Martin_fr
[March 18, 2025, 08:22:41 pm]
Dialogs and TTimer inside...
by
d2010
[March 18, 2025, 08:13:19 pm]
Add,update and delete by ...
by
wcage03
[March 18, 2025, 07:42:11 pm]
DbGrid or TSQLQuery best ...
by
wcage03
[March 18, 2025, 07:32:28 pm]
Converting a Project from...
by
wcage03
[March 18, 2025, 07:25:26 pm]
Undefined symbol: WSRegis...
by
d2010
[March 18, 2025, 07:15:20 pm]
TValueListEditor wont acc...
by
paule32
[March 18, 2025, 07:04:33 pm]
File open or File close -...
by
paule32
[March 18, 2025, 06:48:39 pm]
How To: Create and React ...
by
zxandris
[March 18, 2025, 05:19:20 pm]
Cursor changes to arrow o...
by
atlatl
[March 18, 2025, 05:16:44 pm]
dmg may contain virus
by
turunk
[March 18, 2025, 05:02:19 pm]
i have function named sho...
by
Thaddy
[March 18, 2025, 04:33:29 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: on form drag and drop file option (Read 422 times)
Packs
Sr. Member
Posts: 476
on form drag and drop file option
«
on:
February 14, 2025, 08:36:29 am »
On form there is drag and drop option it is working properly .
I have one form where on top of form lot of panel and memo component.
it is not working because form event can not raised .
how to achieve this
Logged
cdbc
Hero Member
Posts: 1953
Re: on form drag and drop file option
«
Reply #1 on:
February 14, 2025, 11:17:59 am »
Hi
Forward the event to the components in question...
Regards Benny
Logged
If it ain't broke, don't fix it
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 3.6 up until Jan 2024 from then on it's both above &: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 4.99
Packs
Sr. Member
Posts: 476
Re: on form drag and drop file option
«
Reply #2 on:
February 14, 2025, 11:21:36 am »
Code: Pascal
[Select]
[+]
[-]
procedure
Tfrminward
.
FormDropFiles
(
Sender
:
TObject
;
const
FileNames
:
array
of
string
)
;
begin
if
Length
(
FileNames
)
>
1
then
begin
ShowMessage
(
'Select one file'
)
;
Exit
;
end
;
Opendlg_inward
.
FileName
:
=
FileNames
[
0
]
;
end
;
form FormDropFiles event should run.
it is get protected if you have panel or other components in form.
Logged
cdbc
Hero Member
Posts: 1953
Re: on form drag and drop file option
«
Reply #3 on:
February 14, 2025, 11:41:59 am »
Hi
If your whole form is covered with components, I've found it easiest to just let the /drop/ event-handlers of said components, just point to the same one - namely the one you have for the form...
Regards Benny
Logged
If it ain't broke, don't fix it
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 3.6 up until Jan 2024 from then on it's both above &: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 4.99
Packs
Sr. Member
Posts: 476
Re: on form drag and drop file option
«
Reply #4 on:
February 14, 2025, 11:47:56 am »
in that case I have to write event for all component .
it should be simple user will drag and drop any where , my form dragfile event should trigger .
Logged
cdbc
Hero Member
Posts: 1953
Re: on form drag and drop file option
«
Reply #5 on:
February 14, 2025, 12:06:37 pm »
Hi
No, just point all the components' handlers to the one you have written for the form, they have the same signature. You can do that in the Object Inspector.
Regards Benny
Logged
If it ain't broke, don't fix it
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 3.6 up until Jan 2024 from then on it's both above &: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 4.99
Packs
Sr. Member
Posts: 476
Re: on form drag and drop file option
«
Reply #6 on:
February 14, 2025, 12:09:27 pm »
all component is having different signature .
on formdrag event accept file other all accepting x,y position or string
Logged
cdbc
Hero Member
Posts: 1953
Re: on form drag and drop file option
«
Reply #7 on:
February 14, 2025, 12:31:29 pm »
...Then Google is your friend ...I guess.
eta: At least you need someone more knowledgeable than me, regarding the intricacies of the LCL.
«
Last Edit: February 14, 2025, 12:35:54 pm by cdbc
»
Logged
If it ain't broke, don't fix it
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 3.6 up until Jan 2024 from then on it's both above &: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 4.99
Packs
Sr. Member
Posts: 476
Re: on form drag and drop file option
«
Reply #8 on:
February 14, 2025, 12:46:58 pm »
Ok Sir 👍
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
on form drag and drop file option
TinyPortal
© 2005-2018