Skip to main content

Using Drag and Drop In Visual FoxPro

I recently had to revisit this article (originally written in 2001) for a more recent project.

I was implementing drag/drop but it also had to co-exist with a right-mouse click and a Double-click event that were pulling up Visual FoxPro forms.

The objects being used weren't ActiveX controls but regular FoxPro controls, but if you use the standard DragMode and Drag events in the VFP base classes, they conflict with the Double-click and right-click events.

The solution? Use the OLE Drag and Drop.

Now one thing that's not mentioned in this article is a property called CreateDragImage. That's a property Windows uses often with ListView controls to create that shaded image that appears under the cursor when it's being dragged. Sadly, that function doesn't work properly with Visual FoxPro so you have to build your own cursor or icon to make it look right.

This is one of those things where the FoxTeam at Microsoft might want to look for ideas for Visual FoxPro 10. Why? Because these are the little things that work in other environments but don't work in VFP that bug the FoxPro developers. There may be a hundred (valid!) reasons for it and it would take an army to figure them all out but they always cause those little moments where people go "damn! - why doesn't this work."

Using Drag and Drop In Visual FoxPro

Comments

Popular posts from this blog

Using Genmenux

A session and white paper I gave back in 1994 at the German Devcon. From the white paper:

If you have ever felt cheated by the FoxPro Menu Builder and the limits it places on you, GENMENUX offers a perfect solution.

Just as GENSCRNX extends the FoxPro Screen Builder in ways that the original developers never imagined, GENMENUX attempts to extend the Menu Builder. The idea behind the "X" series of generators is that there are times when FoxPro does not provide everything required in the Power Tools. The "X" series provides the additional functionality that can add incredible power to these tools.

A copy of this paper is also available here

Genmenux