1. Rick Domogalik
  2. PowerBuilder
  3. Thursday, 5 September 2019 18:33 PM UTC

I am needing to implement Drag and Drop functionality with my program.  I have successfully put in the ability to drag into the app from windows explorer.  I am struggling to find a way to be able to drag files back out of the app to Windows Explorer.

I have seen a couple of posts using the windows API but this seems crazy complex to use.  Does anyone have an example of how they implemented drag out functionality?

 

Any help would be greatly appreciated.

 

 

Rick

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 6 September 2019 03:53 AM UTC
  2. PowerBuilder
  3. # 1

I realise a few things with respect to my previous answer:

1) No one knows if MS is going to keep releasing the WebBrowser control, or if they change it to something we won't be able to use anymore.

2) You'd still have to code your left panel yourself to browse in a treeview through disks and folders (not so hard and there'll be examples).

3) Why re-invent the wheel? Take a look at this https://www.jam-software.com/developer/

They have an activeX (I guess) for Delphi, so that should work with Powerbuilder too.

Not too sure about the licensing. The price per developer seems very cheap, but I don't know if that means free distribution to your customers.

Comment
  1. Michael Kramer
  2. Friday, 6 September 2019 08:19 AM UTC
New MS WebView2 based on new Edge/Chromium. Currently in preview. Maybe coming this fall post .NET Core 3 release?

DOCS: https://docs.microsoft.com/en-us/microsoft-edge/hosting/webview2

HTH /Michael
  1. Helpful
  1. Miguel Leeuwe
  2. Friday, 6 September 2019 08:24 AM UTC
Hi Michael,

Yes I know, but I keep reading that MS seems to be getting away from Edge too. So I wouldn't put my bets on it.

Though you can always look for another solution when time would come of course.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 6 September 2019 02:24 AM UTC
  2. PowerBuilder
  3. # 2

If you want to keep it simple, you'd have to have an explorer within a window. You can use the "Microsoft Web browser" ActiveX (see attached Image). At this moment you'd be showing the files somehow in your powerbuilder application, so use the ole control to do that.

To see what I mean: In the constructor event of the OLE control write:

this.object.Navigate("C:\") // for example

 

Mark the attribute of the ole control "IsDragTarget", though I'm not 100 % sure if that's even needed. It worked for me.

That will give you something like a file explorer, but you still have to tweak it to show side panels etc. Let me know if you need help with that.

From that moment on, you can just drop files from a windows file explorer onto the ole control and vice versa. 

No coding needed at all!

Attachments (1)
Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.