none
Vertical TextBox

    Question

  • I am trying to create a vertical TextBox (i.e., text reads from bottom to top, or top to bottom, rather than left to right).  The code I have tried follows.  Unfortunately, it looks like the text box that I see is only 200 wide by 200 tall.  How would I accomplish a 300 tall by 200 wide vertical text box?

    <UserControl x:Class="RotatedTextbox" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="200" Height="300" x:Name="RotateTextBox"
        <Grid> 
            <TextBox Height="200" Width="300" HorizontalAlignment="Left" VerticalAlignment="Top" Name="TextBox1" Text="Hello hjkhkj  hj h  huilj hiul hlkjh ljkh jklhkjlh jklh jklh ljkh jklh jlkh jklh ljkh ljkh jlkhuioguyg uygf uygh ghhu gjkg"
                <TextBox.RenderTransform> 
                    <TransformGroup> 
                        <RotateTransform CenterX="100" CenterY="150" Angle="90"/> 
                        <TranslateTransform X="-50" Y="-50" /> 
                    </TransformGroup> 
                </TextBox.RenderTransform> 
            </TextBox> 
        </Grid> 
    </UserControl> 
     



    Sunday, July 20, 2008 11:03 PM

Answers

  • Kevin,

    Just out of interest, have you tried using LayoutTransform instead of RenderTransform? Maybe the control is being overlapped by other content that's not moving out of its way.

    Matt
    • Proposed as answer by DutchMarcel Monday, July 21, 2008 7:46 AM
    • Marked as answer by Kevin8264 Monday, July 21, 2008 1:22 PM
    Monday, July 21, 2008 12:36 AM

All replies

  • Kevin,

    Just out of interest, have you tried using LayoutTransform instead of RenderTransform? Maybe the control is being overlapped by other content that's not moving out of its way.

    Matt
    • Proposed as answer by DutchMarcel Monday, July 21, 2008 7:46 AM
    • Marked as answer by Kevin8264 Monday, July 21, 2008 1:22 PM
    Monday, July 21, 2008 12:36 AM
  • Weird...but it works!
    Monday, July 21, 2008 7:53 PM