customizing-Custom Drag-and-drop

Source: Internet
Author: User
Tags ole

The default implementation of drag-and-drop is sufficient for most applications, however, many applications require these standards to change the behavior of these standards. This article describes how to change these default steps. In addition, you can use this technique to build applications that do not support compliant documents as drop sources.

If you are customizing the OLE drag-and-drop behavior or if you already have a non-OLE application, you must create a COleDataSource object to contain the data. When the user starts a drag-and-drop operation, your code should call the DoDragDrop function in that object instead of in other classes that support drag-and-drop operations.

In addition, you can create a COleDropSource object to control the drop and overload many of its functions, increasing the dependency on the type of behavior you want to change. This drop source object is passed to the COleDataSource::D odragdrop To change the default behavior of these functions. These different options allow you to support drag-and-drop operations in your program with more flexibility. For more information about the data source, see the Objects and the number Sources (OLE).

You can overload the following function to customize the drag-and-drop operation:

Onbegindrag How to initialize a drag after you call DoDragDrop
GiveFeedback Visual returns, such as different drag results, different cursors
QueryContinueDrag Terminates the drag operation. This function allows you to detect the state of modifier keys during the drag process.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.