1.创建WPF控件并布局同时与WinForm关联
(1).创建WPF用户控件并布局
<UserControl
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:DemoCollection" x:Class="DemoCollection.WPFUserControl2"
mc:Ignorable="d"
d:DesignHeight="371" d:DesignWidth="706">
<Viewbox x:Name="Viewbox" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Stretch="Fill">
<StackPanel x:Name="StackPanel1" >
<Slider x:Name="Slider1" Width="113" Panel.ZIndex="11" ValueChanged="Slider1_ValueChanged" Margin="700,0,0,0"/>
<ScrollViewer x:Name="ScrollViewer1" Height="464" Width="907" Margin="0,0