Olá Elias Júnior,
Este exemplo que estou te passando esta em wpf/vb, mas não vai ser difícil você mudar para c#! Espero que te ajude.
<Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<!--<Grid Name="grid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="100*" />
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<Grid.RowDefinitions>
<RowDefinition Height="25"/>
<RowDefinition Height="25"/>
</Grid.RowDefinitions>
<Button Name="btnCreateCanvas" Margin="2" Content="Create Canvas" Grid.Row="0"/>
<Button Name="btnCreateRectangle" Margin="2" Content="Create Rectangle " Grid.Row="1"/>
</Grid>
</Grid>-->
<Canvas x:Name="canv" ToolTip="tt one" Width="400" Height="260" Background="AliceBlue" >
<Rectangle x:Name="rec" Fill="Black" Height="50" Width="50" MouseDown="Rectangle_MouseDown" MouseMove="Rectangle_MouseMove" MouseUp="Rectangle_MouseUp" />
</Canvas>
</Window>
Private isDragging As Boolean
Private Sub Rectangle_MouseDown(sender As Object, e As System.Windows.Input.MouseButtonEventArgs)
rec.CaptureMouse()
isDragging = True
End Sub
Private Sub Rectangle_MouseMove(sender As Object, e As System.Windows.Input.MouseEventArgs)
If isDragging Then
Dim canvPosToWindow As Point = canv.TransformToAncestor(Me).Transform(New Point(0, 0))
Dim r As Rectangle = TryCast(sender, Rectangle)
Dim upperlimit = canvPosToWindow.Y + (r.Height / 2)
Dim lowerlimit = canvPosToWindow.Y + canv.ActualHeight - (r.Height / 2)
Dim leftlimit = canvPosToWindow.X + (r.Width / 2)
Dim rightlimit = canvPosToWindow.X + canv.ActualWidth - (r.Width / 2)
Dim absmouseXpos = e.GetPosition(Me).X
Dim absmouseYpos = e.GetPosition(Me).Y
If (absmouseXpos > leftlimit AndAlso absmouseXpos < rightlimit) AndAlso (absmouseYpos > upperlimit AndAlso absmouseYpos < lowerlimit) Then
r.SetValue(Canvas.LeftProperty, e.GetPosition(canv).X - (r.Width / 2))
r.SetValue(Canvas.TopProperty, e.GetPosition(canv).Y - (r.Height / 2))
End If
End If
End Sub
Private Sub Rectangle_MouseUp(sender As Object, e As System.Windows.Input.MouseButtonEventArgs)
rec.ReleaseMouseCapture()
isDragging = False
End Sub