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

User Interface Design in Web and Windows

This is the white paper on user interface design that was given at a number of conferences including DevTeach 2003 and others.

From the overview:
"  Interfaces are a lot like people – no two are ever really alike. That can present a problem for developers and end-users. On one hand, you want to provide a clear , consistent and easy to use experience for the user. On the other, you want to showcase your graphical design skills. This session goes through some of the issues confronting interface designers today and how we can best deal with them. "

This session discusses the benefits of the Inductive User Interface, a concept that Microsoft initially showed in MS Money 2001 but has found its way into certain aspects of Windows XP, Office and other tools.

Is the Inductive Approach really the best way? Well, it certainly works for new users, who can't discern between icons. As I look at my tool bar in IE right now, I can easily see that the magnifying glass means "Se…