rotating a button in blend within a stackpanel

  • rotating a button 90 degrees in Blend within a horizontal stackpanel seems to result in the stack panel using the button width instead of height for layout of the stack, any ideas is this common issue?


  • Hi JLM,
    Just to clarify what you are asking, the problem you face looks similar to the following image:

    http://img508.imageshack.us/img508/6971/capturexm1.png (http://imageshack.us)
    http://img508.imageshack.us/img508/6971/capturexm1.2bbf96dad6.jpg (http://g.imageshack.us/g.php?h=508&i=capturexm1.png)

    What you are interested in doing is have the stackpanel fit all objects snugly without leaving that huge gap on both the left and right sides of the rotated button?

    Cheers!
    Kirupa =)


  • Not seen many flash forums with blend expertise, this seemed one of the only places with any discussion on using it, how about a section for blend/silverlight/WPF/C# ??


  • Yer, exactly.

    Thanks for taking a look.

    I have just managed to solve the prob so might as well post the info, turns out the problem is that blend assumes the less processor heavy action the RenderTransform, which happens after layout. But instead I just need to use LayoutTransform which happens before layout and is taken into account during layout. So after rotating I just need to change the XAML to use the word LayoutTransform instead of RenderTransform - typical of XAML very simple if you know!

    For example with a simple case of just rotation a textfield with some borders.

    eg














  • JLM - glad to see you had it sorted out. I was about to suggest what you found out, but I wanted to make sure I wasn't overlooking a more important detail! In Blend, if you select your Button (or most other controls), there are two Transform properties panels - RenderTransform and LayoutTransform. If you alter the rotation via the LayoutTransform panel, then you do not have to manually alter the XAML code. The problem is that the default rotation/scale/etc. handles in the design view alter the RenderTransform properties afaik.

    A forum for Blend/WPF/C#/etc. is in the pipeline. I'm currently writing several tutorials covering those topics http://www.kirupa.com/net/index.htm and http://www.kirupa.com/blend_wpf/index.htm Once I get enough tutorials, then it makes sense to have a forum for them.

    Also, if you have any suggestions for future Blend tutorials, feel free to let me know :)







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about rotating a button in blend within a stackpanel , Please add it free.