Click here to Skip to main content
15,890,512 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: How i can know who the users connected in my application? Pin
VisualLive23-May-09 7:10
VisualLive23-May-09 7:10 
QuestionHow to implement Drag and drop functionality using WPF Pin
Nekkantidivya22-May-09 18:57
Nekkantidivya22-May-09 18:57 
AnswerRe: How to implement Drag and drop functionality using WPF Pin
ABitSmart23-May-09 4:17
ABitSmart23-May-09 4:17 
AnswerRe: How to implement Drag and drop functionality using WPF Pin
derm223-May-09 8:39
derm223-May-09 8:39 
GeneralRe: How to implement Drag and drop functionality using WPF Pin
Mark Salsbery23-May-09 9:18
Mark Salsbery23-May-09 9:18 
GeneralRe: How to implement Drag and drop functionality using WPF Pin
derm224-May-09 5:42
derm224-May-09 5:42 
GeneralRe: How to implement Drag and drop functionality using WPF Pin
Mark Salsbery24-May-09 7:09
Mark Salsbery24-May-09 7:09 
GeneralRe: How to implement Drag and drop functionality using WPF Pin
derm225-May-09 1:44
derm225-May-09 1:44 
Indeed. Your example doesn't fire that event, but it wouldn't be random if it always happened Smile | :)

Put this onto your form, and expand the root node. Mousemove will be fired, and you will start a drag operation if you don't check the position.

class Tree2 : TreeView
	{

		public Tree2()
		{
			TreeViewItem root = new TreeViewItem();
			root.Header = "root";
			TreeViewItem child = new TreeViewItem();
			root.Items.Add(child);
			this.Items.Add(root);
			this.PreviewMouseDown += new MouseButtonEventHandler(Tree2_PreviewMouseDown);
			this.PreviewMouseMove += new MouseEventHandler(Tree2_PreviewMouseMove);
		}
		Point lastMouseDown;
		bool readyToDrag = false;

		void Tree2_PreviewMouseDown(object sender, MouseButtonEventArgs e)
		{
			lastMouseDown = e.GetPosition(this);
			readyToDrag = true;
		}

		void Tree2_PreviewMouseMove(object sender, MouseEventArgs e)
		{
			Point currentPosition = e.GetPosition(this);

			if (readyToDrag)
			{
				if (currentPosition == lastMouseDown)
				{
					throw new Exception("This is a mousemove event fired for a mouseclick");
				}
				else
				{
					//do the DragDrop here
				}
			}
		}
	}

GeneralRe: How to implement Drag and drop functionality using WPF Pin
Mark Salsbery25-May-09 6:45
Mark Salsbery25-May-09 6:45 
QuestionAnother M-V-VM question: lookups Pin
ml_black22-May-09 4:23
ml_black22-May-09 4:23 
AnswerRe: Another M-V-VM question: lookups Pin
Pete O'Hanlon22-May-09 4:36
mvePete O'Hanlon22-May-09 4:36 
GeneralRe: Another M-V-VM question: lookups Pin
ml_black22-May-09 4:48
ml_black22-May-09 4:48 
GeneralRe: Another M-V-VM question: lookups Pin
ml_black22-May-09 6:18
ml_black22-May-09 6:18 
GeneralRe: Another M-V-VM question: lookups Pin
Pete O'Hanlon22-May-09 11:40
mvePete O'Hanlon22-May-09 11:40 
QuestionMaskText box is not scrolling in scrollviewer, in WPF Pin
Asit Kumar Sinha22-May-09 2:28
Asit Kumar Sinha22-May-09 2:28 
AnswerRe: MaskText box is not scrolling in scrollviewer, in WPF Pin
Mark Salsbery22-May-09 6:31
Mark Salsbery22-May-09 6:31 
QuestionCreating this sort of style in WPF/Blend Pin
pancakesOfMassDeliciousness22-May-09 2:15
pancakesOfMassDeliciousness22-May-09 2:15 
AnswerRe: Creating this sort of style in WPF/Blend Pin
Mark Salsbery22-May-09 5:09
Mark Salsbery22-May-09 5:09 
AnswerRe: Creating this sort of style in WPF/Blend Pin
Gideon Engelberth22-May-09 15:12
Gideon Engelberth22-May-09 15:12 
AnswerRe: Creating this sort of style in WPF/Blend Pin
Unagii10-Feb-10 3:22
Unagii10-Feb-10 3:22 
GeneralRe: Creating this sort of style in WPF/Blend Pin
pancakesOfMassDeliciousness10-Feb-10 3:27
pancakesOfMassDeliciousness10-Feb-10 3:27 
GeneralRe: Creating this sort of style in WPF/Blend Pin
Unagii10-Feb-10 3:45
Unagii10-Feb-10 3:45 
GeneralOverview: WPF Pin
Kamal Gurnani22-May-09 0:44
Kamal Gurnani22-May-09 0:44 
GeneralRe: Overview: WPF Pin
Pete O'Hanlon22-May-09 0:58
mvePete O'Hanlon22-May-09 0:58 
GeneralRe: Overview: WPF Pin
Allen Anderson25-May-09 17:49
Allen Anderson25-May-09 17:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.