8,756
社区成员




<StackPanel >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Border x:Name="Border_Title" Grid.Row="0" Height="40" Width="525" Background="LightBlue" BorderThickness="0,0,0,1" BorderBrush="Black"></Border>
</Grid>
<!--<Border x:Name="Border_Title" Grid.Row="0" Height="40" Width="525" Background="LightBlue" BorderThickness="0,0,0,1" BorderBrush="Black"></Border>-->
</StackPanel>
通过Border的鼠标按下事件,调用 this.DragMove(); 方法即可
public MainWindow()
{
InitializeComponent();
this.Border_Title.MouseDown += new MouseButtonEventHandler(Border_Title_MouseDown);
}
void Border_Title_MouseDown(object sender, MouseButtonEventArgs e)
{
this.DragMove();
}