Moving a second window.

I'm trying to work out the best way to get a second window to move when I drag my first window.

I know how to use window.DragMove() but this only works on the window that has been clicked on.

I have tried using something like

window2.Left = this.Left + x;
window2.Top = this.Top + y;

in the mousemove event of window1 when it is being dragged but this is very slow and jerky.

Is there a better way to move a window's position?

[530 byte] By [stuntpope] at [2007-12-22]
# 1

Let me just clarify what I'm asking here.

I've realised that it is possible to call DragMove() on another window. What isn't possible is to call it on two windows at the same time.

I'm hoping that there's a straightforward way to get two windows to move at the same time.

Any ideas?

stuntpope at 2007-8-30 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 2
Have you tried setting the second window's Top & Left in the first window's LocationChanged event handler?
HuaWang at 2007-8-30 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 3

Hi Hua,

Thanks for your response. I'm sure I tried this before and it was running very slowly but your post prompted me to try again. It now seems to be working ok. I can't think what I might have been doing differently but anyhow thanks again.

stuntpope at 2007-8-30 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...

Visual Studio Orcas

Site Classified