Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. WPF Rotate transform issue

WPF Rotate transform issue

Scheduled Pinned Locked Moved WPF
helpcsharpcsswpfquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shane5555
    wrote on last edited by
    #1

    Hi, I have a problem with rotating a WPF UIElement and placing it within a small space. Consider the following problem:

    <Grid HorizontalAlignment="Center" VerticalAlignment="Center" Width="30" Height="100">
    <Button Content="This is my button"
    HorizontalAlignment="Center"
    VerticalAlignment="Center"
    Width="100"
    Height="30"
    RenderTransformOrigin="0.5,0.5">
    <Button.RenderTransform>
    <RotateTransform Angle="90" />
    </Button.RenderTransform>
    </Button>

    WPF seems to draw the grid, draw the button (with the sides cut off) and then rotate the button (without sides). Has anyone encountered this problem before? Shane

    I 1 Reply Last reply
    0
    • S Shane5555

      Hi, I have a problem with rotating a WPF UIElement and placing it within a small space. Consider the following problem:

      <Grid HorizontalAlignment="Center" VerticalAlignment="Center" Width="30" Height="100">
      <Button Content="This is my button"
      HorizontalAlignment="Center"
      VerticalAlignment="Center"
      Width="100"
      Height="30"
      RenderTransformOrigin="0.5,0.5">
      <Button.RenderTransform>
      <RotateTransform Angle="90" />
      </Button.RenderTransform>
      </Button>

      WPF seems to draw the grid, draw the button (with the sides cut off) and then rotate the button (without sides). Has anyone encountered this problem before? Shane

      I Offline
      I Offline
      Insincere Dave
      wrote on last edited by
      #2

      Try LayoutTransform instead of RenderTransform.

      S 1 Reply Last reply
      0
      • I Insincere Dave

        Try LayoutTransform instead of RenderTransform.

        S Offline
        S Offline
        Shane5555
        wrote on last edited by
        #3

        Sorted... thanks Dave

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups