if i have a textblock which i want to vary in width by the size of its contents, but i want the left of the textblock to maintain a certain spacing from the right of the container… how is this accomplished? I feel I’m overlooking something simple. Im specifically using WPF, if that matters.
Share
The solution would be to place the TextBlock inside a
StackPanellike this:-Where Width 200 represents the fixed distance you want the left border of the
TextBlockto be away from the right border of the element containing theStackPanel.