开发者

C# - How does DataFormats.GetDataFormat work?

开发者 https://www.devze.com 2022-12-18 07:07 出处:网络
I am trying to figure out Drag And Drop using the features in the FluidKit. I downloaded the Demo app and both the drag and drop have this line of code in it:

I am trying to figure out Drag And Drop using the features in the FluidKit.

I downloaded the Demo app and both the drag and drop have this line of code in it:

private static DataFormat SupportedFormat = DataFormats.GetDataFormat("FluidKit");

What is this doing? I don't see anywhere that the format that is being gotten is se开发者_如何学编程t. How does it know what it being gotten?

Any help would be nice.


The DataFormat is just describing the type of object that is being dropped on your control. For instance, if you drag a couple of items from a ListView onto some other ListView you could check to be sure the data format you're receiving is "System.Windows.Forms.ListViewItem[]". If you receive a DataFormat that your control can't handle, then you can just choose to cancel the drop event, or prompt the user, etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消