2
如何使用鼠標在網格wpf內拖放控件?使用鼠標在網格wpf內拖放控件
<Window x:Class="Animation_Move.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" >
<Grid>
<Grid Name="Grm" Width="500" Height="500" Background="#FF14831E">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="100"/>
<RowDefinition Height="100"/>
<RowDefinition Height="100"/>
<RowDefinition Height="100"/>
<RowDefinition Height="100"/>
</Grid.RowDefinitions>
<Image Name="Soldier" Grid.Row="1" Grid.Column="1" Source="Soldier-Red.png" Width="26" Height="34" ></Image>
</Grid>
</Grid>
我需要從第一行偏移控制到第二row.Is這可能與鼠標? 我需要拖放圖像控件。
有這[頁碼]你的問題的解決方案(http://stackoverflow.com/questions/25282443/drag-and-drop-custom-controls -single-in-a-grid-in-wpf)http://stackoverflow.com/questions/25282443/drag-and-drop-custom-controls-between-cells-in-a-grid-in-wpf –