Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic diagram DragOver (Read 1365 times)
Joe
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 21
Joined: Jun 6th, 2012
diagram DragOver
Nov 27th, 2012 at 10:28am
Print Post  
When drawing board outside drag files to the drawing board, judgment document type, not known file type, drag files in drawing board then change the mouse shape

How can I this issue?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: diagram DragOver
Reply #1 - Nov 27th, 2012 at 1:19pm
Print Post  
You can indicate whether you accept the operation from the DragOver event handler. E.g. this will show the + cursor if you accept the files or the stop cursor otherwise:

Code
Select All
private void OnDragOver(object sender, DragEventArgs e)
{
	e.Handled = true;
	e.Effects = DragDropEffects.None;

	var formats = e.Data.GetFormats();
	if (Array.IndexOf(formats, "FileName") != -1)
	{
		var fileNames = (string[])e.Data.GetData("FileName");
		foreach (string file in fileNames)
		{
			if (file.ToLower().EndsWith(".ico"))
			{
				e.Effects = DragDropEffects.Copy;
				break;
			}
		}
	}
} 



I don't think you can set a custom cursor shape from the drag target application, since it is controlled by the drag source. If the source is your own application, check the GiveFeedback event topic on MSDN.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint