{
If (isDragDropInEffect)
{
FrameworkElement currEle=sender as FrameworkElement;
Double xPos=um participant etPosition (this). X-ray pos. X + currEle. Margin. The Left;
Double yPos=um participant etPosition (this) - pos. Y Y + currEle. Margin. The Top;
CurrEle. Margin=new Thickness (xPos, xPos, 0, 0);
Pos=um participant etPosition (null);
}
}
Private void Element_MouseLeftButtonDown (object sender, MouseButtonEventArgs e)
{
FrameworkElement fEle=sender as FrameworkElement;
IsDragDropInEffect=true;
Pos=um participant etPosition (null);
FEle. CaptureMouse ();
FEle. Cursor=your Cursors. Hand;
}
The mouse control, the control can't keep up with the mouse speed, and finally finish the mouse shows not stop position in the mouse,
CodePudding user response:
Help!!!!!! Just learning not long time, thank you very muchCodePudding user response:
Mobile is with Thumb, temporary write a simple example ofThe front desk, add a canvas, name "MainBox
.
Title="MainWindow" Height="450" Width="800" & gt;
The background
Public MainWindow ()
{
InitializeComponent ();
Canvas Move_Box=new Canvas ()
{
Width=100,
Height=100,
Background=Brushes. Green
};
Canvas. SetLeft (Move_Box, 10);
Canvas. SetTop (Move_Box, 10);
MainBox. Children. The Add (Move_Box);
Thumb Thumb=new Thumb ()
{
Width=100,
Height=100,
Opacity=0
};
Thumb. DragDelta +=(s, e)=& gt;
{
Canvas. SetLeft (Move_Box, Canvas. GetLeft (Move_Box) + e.H orizontalChange);
Canvas. SetTop (Move_Box, Canvas. GetTop (Move_Box) + e.V erticalChange);
};
Move_Box. Children. The Add (thumb);
}
CodePudding user response:
I didn't write canvas with border and the embedded web pageIn front of the web pages to write.
CodePudding user response:
AAA