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
Move tab to other pagecon...
by
Martin_fr
[
Today
at 04:40:41 pm]
TATTabs and Modified stat...
by
AlexTP
[
Today
at 04:34:48 pm]
Online Package Manager
by
Thaddy
[
Today
at 04:13:28 pm]
Remote access to database...
by
wcage03
[
Today
at 04:04:34 pm]
i have function named sho...
by
Thaddy
[
Today
at 03:11:06 pm]
Lazarus crashes when link...
by
grl
[
Today
at 01:58:43 pm]
How to rename or move a s...
by
anse
[
Today
at 12:49:14 pm]
Difference in behavior fo...
by
lhl
[
Today
at 11:39:42 am]
[maybe SOLVED] BUG in Inp...
by
robert rozee
[
Today
at 11:26:58 am]
IfThenStr does not work -...
by
Thaddy
[
Today
at 10:51:48 am]
TDateEdit - And dates bef...
by
OC DelGuy
[
Today
at 09:54:29 am]
Creating Self Signed Cert...
by
MarkMLl
[
Today
at 08:32:01 am]
Hustle - A simple task ma...
by
Hansvb
[
Today
at 07:54:32 am]
Segmentation fault
by
cdbc
[
Today
at 07:24:34 am]
Converting a Project from...
by
TRon
[
Today
at 04:34:52 am]
PostgreSQL "no route to h...
by
wcage03
[
Today
at 02:26:44 am]
Bug in md5 unit?
by
Bart
[March 16, 2025, 10:57:41 pm]
TValueListEditor wont acc...
by
Bart
[March 16, 2025, 10:47:09 pm]
Force parameters of my ap...
by
Ericktux
[March 16, 2025, 09:17:46 pm]
R3D - 3D Rendering Librar...
by
Lulu
[March 16, 2025, 07:57:46 pm]
TControlBar and hence the...
by
jamie
[March 16, 2025, 07:42:53 pm]
Qt 6.7 font features opti...
by
AlexTP
[March 16, 2025, 07:36:46 pm]
Hooking to `OnISupport` d...
by
Gustavo 'Gus' Carreno
[March 16, 2025, 07:32:14 pm]
NIL vs. Assign: when to u...
by
Zoran
[March 16, 2025, 07:09:40 pm]
mp4 video programming wit...
by
Thaddy
[March 16, 2025, 05:58:48 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: on form drag and drop file option (Read 419 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: 1946
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: 1946
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: 1946
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: 1946
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