Hi there,
I have been experimenting with having windows maximise when you drag them to the top, like in Windows 7.
However, using this.CaptureMouse(); in the RadWindow stops the window from being able to be moved.
As you can see from the code I tried to handle moving the window myself, however this causes the resize arrow to appear even if I drag from the header or inside the Window.
Is this a bug or is there a correct way to use CaptureMouse?
Thanks
I have been experimenting with having windows maximise when you drag them to the top, like in Windows 7.
However, using this.CaptureMouse(); in the RadWindow stops the window from being able to be moved.
private
void
RadWindow_MouseLeftButtonDown(
object
sender, MouseButtonEventArgs e)
{
vertPosition = e.GetPosition(
null
).Y;
isCaptured =
true
;
this
.CaptureMouse();
}
private
void
RadWindow_MouseMove(
object
sender, MouseEventArgs e)
{
if
(isCaptured)
{
vertPosition = e.GetPosition(
null
).Y;
this
.Top = e.GetPosition(
null
).Y;
this
.Left = e.GetPosition(
null
).X;
}
}
private
void
RadWindow_MouseLeftButtonUp(
object
sender, MouseButtonEventArgs e)
{
if
(isCaptured)
{
if
(vertPosition < 30.0)
this
.Height = App.Current.Host.Content.ActualHeight;
this
.Width = App.Current.Host.Content.ActualWidth;
}
isCaptured =
false
;
this
.ReleaseMouseCapture();
}
Is this a bug or is there a correct way to use CaptureMouse?
Thanks