Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8257859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:20:40+00:00 2026-06-08T02:20:40+00:00

How do you rotate one item in a StackPanel or other container and still

  • 0

How do you rotate one item in a StackPanel or other container and still keep the alignment?

What I’m trying to do is have a label with the name of the item with the text orientated up and down and a result value that will be unrotated directly underneath of it. The reason for this is that the name of items is quite long but the result is just a 1 or 2 digit number so I can squeeze more data on the screen if the labels are up and down.

It seems that items pivot around their original position (top left?) not about their center so an item that was centered below the items original position ends up off to the side but the difference between height and width of the rotated item.

Here is the code I’ve tried so far:

<StackPanel Orientation="Vertical" Margin="0, 0, 0, 0">
        <Label Name="x" Content="{Binding Path=SummarizedTestName}" Height="50" HorizontalAlignment="Center" FontSize="14">
            <Label.RenderTransform>
                <RotateTransform Angle="-90" />
            </Label.RenderTransform>
        </Label>
        <Label Content="{Binding Path=Count}" Width="50" HorizontalAlignment="Center" FontSize="14" />
</StackPanel>

I’ve thought of using a TransformGroup but the problem is that the length of the SummarizedTestName string isn’t known at compile time (being pulled using Entity Framework from a database). I’ve also tried variations of Horizontal and Vertical alignment but none of them seem to work nice because of the way that things rotate.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T02:20:42+00:00Added an answer on June 8, 2026 at 2:20 am

    You might try using the LayoutTransform property instead of the RenderTransform. Since RenderTransform rotates the name label after the layout has been resolved, the count label is positioned as if the name label was still horizontal.

    Using LayoutTransform would rotate the name label before the layout resolution and the count label should line up nicely.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am using XCode 4.2 (with storyboards) I am trying to rotate only one
Does anyone have a better way to rotate a sprite with one finger? My
I have uitabbar application and I Want to rotate just one ViewController with chart
I have successfully written some inline assembler in gcc to rotate right one bit
I have twoo views. I want to rotate one view by 90 degrees, is
I am working on a universal app which has one label. When I rotate
I want to have one picture in my application that I can rotate to
I need to rotate one Shape component (ellipse) around the other one (circle). It's
I have some objects on the screen and would like to rotate only one
I have a one 64-bit integer , which I need to rotate 90 degrees

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.