前端有的,WPF也要有!
先看效果:
方法:使用Canvas设计UserControl。
一、新建UserControl:
<UserControl x:Class="WpfApp1.Slider"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WpfApp1"
mc:Ignorable="d"
Height="210" Width="800">
<Grid>
<Canvas x:Name="canvas" Horizonta