wpf控件拖动

Thumb 拖动 上代码!

 <Window x:Class="Thumb控件移动.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Thumb控件移动"
mc:Ignorable="d"
Title="MainWindow" Height="" Width="">
<Grid Name="grid">
<Grid Height="" Width="" Background="Red">
<Thumb DragDelta="Thumb_DragDelta" Opacity=""> </Thumb>
</Grid>
</Grid>
</Window>
         private void Thumb_DragDelta(object sender, System.Windows.Controls.Primitives.DragDeltaEventArgs e)
{
Thickness margin = grid.Margin;
margin.Top += e.VerticalChange;
margin.Bottom -= e.VerticalChange;
margin.Left += e.HorizontalChange;
margin.Right -= e.HorizontalChange;
grid.Margin = margin;
}

好了可以愉快的拖动了!!!!!!!!!!!!!!!好了可以愉快的拖动了!!!!!!!!!!!!!!!好了可以愉快的拖动了!!!!!!!!!!!!!!!好了可以愉快的拖动了!!!!!!!!!!!!!!!好了可以愉快的拖动了!!!!!!!!!!!!!!!好了可以愉快的拖动了!!!!!!!!!!!!!!!好了可以愉快的拖动了!!!!!!!!!!!!!!!好了可以愉快的拖动了!!!!!!!!!!!!!!!好了可以愉快的拖动了!!!!!!!!!!!!!!!好了可以愉快的拖动了!!!!!!!!!!!!!!!好了可以愉快的拖动了!!!!!!!!!!!!!!!好了可以愉快的拖动了!!!!!!!!!!!!!!!好了可以愉快的拖动了!!!!!!!!!!!!!!!好了可以愉快的拖动了!!!!!!!!!!!!!!!好了可以愉快的拖动了!!!!!!!!!!!!!!!

上一篇:Android viewpager + fragment取消预加载


下一篇:iOS 8 动画执行过程中返回 Crash