WPdoWPF
Vložení kontrolky z WF do WPF
-
Přidáme References->Add Reference
-
Do hlavičky přidáme kód
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Wpf_zaklad.MainWindow"
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
Title="Pokus" Height="539.11" Width="525" Background="{x:Null}" Loaded="Window_Loaded_1">
-
a dále
<Grid x:Name="GridWF" HorizontalAlignment="Left" Height="458.46" Margin="0,31,0,0" VerticalAlignment="Top" Width="486">
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF7996F9" Offset="0.004"/>
<GradientStop Color="#FF010613" Offset="1"/>
</LinearGradientBrush>
</Grid.Background>
<WindowsFormsHost>
<wf:Label x:Name="label" Text="Label z wFormu" />
</WindowsFormsHost>
<WindowsFormsHost>
<wf:NumericUpDown x:Name="NumericUpDown" Value="50" Increment="10" />
</WindowsFormsHost>
</Grid>