wpf控件拖动

2021-07-14 21:16

阅读:668

标签:alc   eve   pre   span   com   bottom   tar   form   object   

Thumb 拖动 上代码!

 1 "Thumb控件移动.MainWindow"
 2         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 3         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 4         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
 5         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 6         xmlns:local="clr-namespace:Thumb控件移动"
 7         mc:Ignorable="d"
 8         Title="MainWindow" Height="350" Width="525">
 9     "grid">
10         "50" Width="50" Background="Red">
11             "Thumb_DragDelta" Opacity="0">
12        
13         14         15     16 
1         private void Thumb_DragDelta(object sender, System.Windows.Controls.Primitives.DragDeltaEventArgs e)
2         {
3             Thickness margin = grid.Margin;
4             margin.Top += e.VerticalChange;
5             margin.Bottom -= e.VerticalChange;
6             margin.Left += e.HorizontalChange;
7             margin.Right -= e.HorizontalChange;
8             grid.Margin = margin;
9         }

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

wpf控件拖动

标签:alc   eve   pre   span   com   bottom   tar   form   object   

原文地址:https://www.cnblogs.com/pu-tao-zi/p/9531332.html


评论


亲,登录后才可以留言!