Skip to main content
Home Forums Silverlight Programming Visual Studio & Silverlight Development Tools How to set a textblock to vertical orientation?
6 replies. Latest Post by slyi on July 5, 2008.
(0)
Frank Wu
Member
76 points
96 Posts
04-08-2008 12:23 PM |
I don't think that using StackPanel is the answer.
g.k.
16 points
9 Posts
05-27-2008 6:47 PM |
How about this:
<TextBlock x:Name="YAxisTitle" HorizontalAlignment="Center" VerticalAlignment="Center" Text="Y-Axis Label" RenderTransformOrigin="0.5,0.5"> <TextBlock.RenderTransform> <RotateTransform Angle="-90"/> </TextBlock.RenderTransform></TextBlock>
It works, but beware of the mysterious clipping described in this thread: http://silverlight.net/forums/t/16035.aspx
jeetAbhi
424 points
81 Posts
06-24-2008 9:59 AM |
<UserControl x:Class="SilverlightPositioningTest.Page" xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
</
You can adjust your textblock width and font-size to see how much text you want in that narrow container. If this has helped please MARK AS ANSWER......
06-24-2008 11:12 AM |
Thank you for your replying. Yes, it can work using TextWrapping in TextBlock, this is a new feature in SL2 Beta 2.
06-25-2008 5:08 AM |
You can adjust your textblock width and font-size to see how much text you want in that narrow container
or also you can play with your margin properties to overcome the problem you just mentioned above here is the code......
<
. If this has helped please MARK AS ANSWER......
06-25-2008 8:48 AM |
Thank you for your answer, I use LineHeight="18" and LineStackingStrategy="BlockLineHeight":
slyi
Participant
824 points
254 Posts
07-05-2008 11:55 AM |
Please see http://blogs.msdn.com/delay/archive/2008/06/19/text-from-a-slightly-different-perspective-verticaltextblock-control-sample-for-silverlight-2.aspx
These methods seem handy for japanese or other asian text