[Gambas-user] File Chooser Drag and Drop

Bruce Steers bsteers4 at gmail.com
Sun Jul 17 12:32:06 CEST 2022


On Sun, 17 Jul 2022 at 03:28, sbungay <sbungay at smartsonsite.com> wrote:

>    Using the file chooser I want to drag one of the files from it
>>>>> (represented by its icon) to a text area and on dropping it have the
>>>>> text area load the file. Can't seem to get this to work, anyone have
>>>>> an
>>>>> example project I can examine?
>>>>
>>>>

There seems to be another issue.
For your specific task of writing the file contents into the textarea.
It seems we cannot override/intercept or turn off the way a textarea pastes
the file name on drop.
I tried using text/uri-list as format, still just the filename is pasted
not the contents.

I even tried setting TextArea1.Drop = False , still it pastes filename in!?
You can make a Button (or something) with Drop enabled, then drag
filechooser files there and the load file into TextArea but using
TextArea_Drop() does nothing at all. still only default behaviour.





*Public Sub Button1_Drop()Dim s As String = Drag.DataIf Not s Then s =
Drag.Paste("text/uri-list") If Exist(s) Then TextArea1.Text =
File.Load(s)End*

TextArea1_Drop() event does not even trigger.
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220717/91f127a1/attachment.htm>


More information about the User mailing list