2014-01-06 37 views

回答

3

System.Windows.Border類是一類Decorator,這意味着它可以具有單個Child元件。在這種情況下,您的孩子將是WindowsFormsHost

XAML:

<Border BorderBrush="Green" BorderThickness="1"> 
    <WindowsFormsHost x:Name="Host"></WindowsFormsHost> 
</Border> 
1

使用border類:

XAML:

<Border BorderThickness="1" BorderBrush="Green"> 
    <WindowsFormsHost x:Name="Host"></WindowsFormsHost> 
</Border> 

CS:

var myBorder = new Border(); 
myBorder.BorderBrush = Brushes.Green; 
myBorder.BorderThickness = new Thickness(1); 
myBorder.Child = new WindowsFormsHost(); 
相關問題