2014-02-12 65 views
0

我正在爲WindowsPhone構建一個應用程序,我需要在我的TextBlock中顯示數據。由於數據的大小很大,我使用ScrollBar來顯示數據。我不想水平滾動。如果數據的大小很大,我想用垂直的ScrollBar將它顯示爲一個段落。請參閱我的Xaml:在TextBlock中顯示完整的數據

<Canvas Height="659" Background="White" HorizontalAlignment="Left" Margin="-40,91,0,0" Name="canvas2" VerticalAlignment="Top" Width="536"> 
      <Image Canvas.Left="76" Canvas.Top="26" Height="227" Name="newsimage" Stretch="Fill" Width="373" /> 
      <TextBlock Canvas.Left="76" Canvas.Top="274" Height="41" Name="datee" Text="" Width="200" Foreground="Green" FontFamily="Verdana" FontSize="24" /> 
      <ScrollViewer Margin="2,0,10,20" VerticalScrollBarVisibility="Auto" AllowDrop="False" ManipulationMode="Control" Height="131" VerticalAlignment="Bottom" Canvas.Left="76" Canvas.Top="347"> 
       <TextBlock Canvas.Left="59" Canvas.Top="334" Height="124" Name="title" Text="" Width="410" Foreground="Black" FontFamily="Verdana" FontSize="24" FontWeight="Bold" /> 
      </ScrollViewer> 

我希望最後一個TextBlock即「標題」具有垂直滾動功能。在這裏,我無法顯示完整的數據;

+0

做到了....需要給textwrap – bhaku

回答

1

設置TextWrapping屬性爲Wrap + VerticalScrollBarVisibility可見的,而不是自動給力的垂直滾動:

<ScrollViewer Margin="0,0,0,476" VerticalScrollBarVisibility="Visible"> 
       <TextBlock TextWrapping="Wrap"> 
          This is just a stupid long text 
          Adding supported languages in the Project Properties tab will 
          new resx file per language that can carry the translated      
          values of your UI strings. The binding in these examples will 
          cause the value of the attributes to be drawn from the .resx 
          file that matches CurrentUICulture of the app at run time. 
       </TextBlock> 
      </ScrollViewer> 

這只是正常

相關問題