Aju
Aju

Reputation: 806

How to enable scroll when keyboard pops up in windows phone?

In my application i want to enable scrolling when soft keyboard pops up! I tried changing the height of scroll viewer in the TextBox_GotFocus event.

this is the xaml code,

 <Grid x:Name="ContentPanel" Margin="0,152,24,21">
        <ScrollViewer x:Name="ScrollViwer" VerticalScrollBarVisibility="Auto" Height="560">
            <Grid>
                <TextBlock HorizontalAlignment="Left" Height="65" Margin="18,10,0,0" TextWrapping="Wrap" Text="Code" VerticalAlignment="Top" Width="180" FontSize="20"/>
                <TextBlock HorizontalAlignment="Left" Height="65" Margin="18,113,0,0" TextWrapping="Wrap" Text="Symbol" VerticalAlignment="Top" Width="180" FontSize="20"/>
                <TextBlock HorizontalAlignment="Left" Height="65" Margin="18,221,0,0" TextWrapping="Wrap" Text="Decimal" VerticalAlignment="Top" Width="180" FontSize="20"/>
                <TextBlock HorizontalAlignment="Left" Height="65" Margin="18,335,0,0" TextWrapping="Wrap" Text="Format" VerticalAlignment="Top" Width="188" FontSize="20"/>
                <TextBox x:Name="CodeTextBox" Tap="CodeTextBox_Tap_1" BorderThickness="1" HorizontalAlignment="Left" Height="77" Margin="8,36,0,0" Background="Transparent" TextWrapping="Wrap" VerticalAlignment="Top" Width="438"/>
                <TextBox x:Name="SymbolTextBox" BorderThickness="1" GotFocus="TextBox_GotFocus" HorizontalAlignment="Left" KeyDown="Symbol_KeyDown" TextChanged="SymbolText_Changed_1" Height="77" Margin="8,144,0,0" TextWrapping="Wrap" Background="Transparent" VerticalAlignment="Top" Width="438"/>

                <Border Background="Transparent" HorizontalAlignment="Left" BorderBrush="#c5c5c5" BorderThickness="1" Height="59" Margin="18,257,0,0" VerticalAlignment="Top" Width="414">
                    <TextBlock x:Name="DecimalTextBox"  Foreground="Black" HorizontalAlignment="Left" Tap="DeacimalTextBox_Tap_1" Height="77" Margin="5,10,0,-28" TextWrapping="Wrap" VerticalAlignment="Top" Width="409" FontSize="24"/>
                </Border>
                <Border Background="Transparent" BorderBrush="#c5c5c5" BorderThickness="1" HorizontalAlignment="Left" Height="59" Margin="18,372,0,0" VerticalAlignment="Top" Width="414">
                    <TextBlock x:Name="FormatTextBox"  Foreground="Black" Tap="FormatTextBox_Tap_1" HorizontalAlignment="Left" Height="77" Margin="5,10,0,-28" TextWrapping="Wrap" VerticalAlignment="Top" Width="409" FontSize="24"/>
                </Border>
            </Grid>
        </ScrollViewer>
        <ListBox x:Name="DecimalPlacesListBox" Background="#cccccc" Visibility="Collapsed" SelectionChanged="DecimalPlaces_SelectionChanged" HorizontalAlignment="Left" Height="140" Margin="18,316,0,0" VerticalAlignment="Top" Width="414">            
    </Grid>
</Grid> 

But it went worthless. How can i enable scroll when keyboard pops up!

Upvotes: 0

Views: 600

Answers (1)

Developer
Developer

Reputation: 4341

I tried changing the width of scroll viewer? - Are you trying to create horizontal scroll?

If Vertical - change the size of Children inside scrollviewer, not the scrollviewer

Upvotes: 1

Related Questions