locked
Problems aligning TextBlock and Ellipse in Blend 2.5 Preview RRS feed

  • Question

  • Hi,

    I'm working through the Silverlight 2.0 Beta 1/Blend 2.5 Preview User Controls tutorial here: http://silverlight.net/learn/labs.aspx - the second one in the User Control document.

    All I want to do is align the horizontal and vertical centres of my TextBlock and Ellipse but they go way off:

    http://img166.imageshack.us/img166/422/alignmentrs8.gif

    Also, when I try to nudge the TextBlock, with arrow keys, it always goes to the left, and when I try to change the size of it by dragging the bottom right control, it expands and moves up to the left! Very strange.

    I'm new to Blend and more used to Flash so I might be missing something. The tutorial doesn't instruct on how to align - I just like my buttons to be aligned centrally for aesthetic reasons :)

    Hope someone can point me in the right direction!

    Thanks.
    Tuesday, April 15, 2008 3:30 PM

Answers

  •  Add a grid to your layout root, double click on it to make it active, then add ellipse, set auto size to fill, then add the textblock and use vertical/horizontal alignments to set it on center.

    Corrado Cavalli [MVP]
    Tuesday, April 15, 2008 9:00 PM

All replies

  •  Add a grid to your layout root, double click on it to make it active, then add ellipse, set auto size to fill, then add the textblock and use vertical/horizontal alignments to set it on center.

    Corrado Cavalli [MVP]
    Tuesday, April 15, 2008 9:00 PM
  • Thanks Corrado, that's perfect! :)
    Thursday, April 17, 2008 2:13 PM