I just rewrote what Harsheath explained and added some photos and code.
- Add scrollviewer to your xaml
- Select a margin in Scrollviewer (best way: click the TestViewer-Code button in XAML to select it)
- Set Margin Values ββfor Auto
- Insert (in XAML) a text field and paste it into the Scrollviewer tag
- Set the height and width of the text box in Auto
- done!
XAML:
<Page x:Class="testapp.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:newcalapp_winrt" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Margin="0,4,0,-4"> <Button Click="showText" Content="ShowText" x:Name="btn" Width="200" Height="56" Margin="1037,620,0,92"></Button> <ScrollViewer x:Name="outputTextBoxScrollViewer" Margin="57,200,700,400"> <TextBox x:Name="outputTextBox" AcceptsReturn="True"/> </ScrollViewer> <ScrollViewer x:Name="outputTextBlockScrollViewer" Margin="57,450,700,169"> <TextBlock x:Name="outputTextBlock"/> </ScrollViewer> </Grid> </Page>
WITH#:
namespace testapp { public sealed partial class MainPage : Page { public MainPage() { this.InitializeComponent(); } void showText(object sender, RoutedEventArgs args) {

http://i.stack.imgur.com/2qDyJ.png ">
source share