I have a TextBox in my Wp7 app which can contain more data than can fit on the viewable screen. I'd like to give the user the ability to actually read the text by scrolling it. This is the way the browser's address bar works. Just slide the text from side to side to read it. Tapping on the text, you enter edit mode (and even in edit-mode, the user can slide the text). I need this to be a TextBox and not a TextBlock because I need data-entry on this field too.
Anybody have any ideas on how this was accomplished in the browser?
You could scroll the entire textbox control, rather than the text within the textbox using the following :-
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <ScrollViewer Grid.Row="0" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Visible"> <TextBox Text="Some really long sample text which we are going to scroll" /> </ScrollViewer> </Grid>
Hope this helps.