2013-04-29 78 views
1

我試圖通過在後面的代碼中使用內容控件的content屬性來加載Window中的UserControl。每件事情都很好,但由於解決問題,我的朋友無法看到頁面上的所有控件。我如何解決這個問題有滾動條。我也試過把ScrollViewer也,但它不工作。所以,我的解決方案適用於開發的更大的Window,但它不適用於更小的分辨率窗口。加載的如何使用WPF中的滾動條加載用戶控件?

示例代碼結構的UserControl

Window.Xaml

<ScrollViewer> 
    <ContentControl Name="ContentX" Margin="15,10,15,0" HorizontalAlignment="Center" VerticalAlignment="Center">  
     <Label FontWeight="Black" FontSize="18" FontFamily="Calibri">Some Content</Label>  
    </ContentControl> 
</ScrollViewer> 

Window.Xaml.cs

ContentX.Content = new UserControl(); 

UserControl.Xaml 
//Contains the Code for User Control 
+0

請張貼一些代碼,您嘗試的最後一件事。 – Natxo 2013-04-29 09:03:02

+0

Hi Naxto請參閱我的示例codeb – Ujjwal27 2013-04-29 09:17:08

+0

滾動查看器解決方案不工作的方式是什麼? – 2013-04-29 09:34:47

回答

0

我得到它解決了我的內容控制是在另一個網格列,其中i固定的寬度和高度是*,現在我刪除它的工作正常,當我把它放入一個滾動查看器