Click here to Skip to main content
15,888,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hye,
i m maing a simple application where
user enters some lines in a textbox.
i've to show it into either a textblock or a textbox.
but whole content can't be shown at a time.
so, i need to scroll that content.
i have used the following code:
(but it doesn't works. Actually, instead of scrolling
the content of textblock/textbox, it scroll the
textblock or the textbox itself.)

<scrollviewer maxheight="135" name="scrollViewer2" width="228" horizontalscrollbarvisibility="Disabled" verticalscrollbarvisibility="Auto">

                <textblock height="185" lineheight="21.333" name="textBlock1" text="TextBlock" width="228" textwrapping="Wrap" />

            </scrollviewer>


<scrollviewer maxheight="149" name="scrollViewer1" width="233" horizontalscrollbarvisibility="Disabled" verticalscrollbarvisibility="Visible">
                
        <textbox height="188" name="textBox2" text="TextBox" width="215" verticalscrollbarvisibility="Visible" textwrapping="Wrap" />
            
</scrollviewer>



Please copy code and review
Posted
Updated 8-Jan-11 1:18am
v4

1 solution

Have you tried something like this:
http://forums.silverlight.net/forums/t/14935.aspx[^]

Regards
Espen Harlinn
 
Share this answer
 
Comments
DeepsMann 8-Jan-11 8:18am    
yes, i've tried right now. but while using update layout event of textblock it displays the
content one character per line. and if i don't use this event the previous problem persist.

thanks for reply.
DeepsMann 11-Jan-11 7:55am    
Thanks..
i got it
Espen Harlinn 11-Jan-11 7:57am    
Good!
DeepsMann 22-Jan-11 8:20am    
"For ALL"

the height of the textblock/textbox must be auto...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900