7gegenTheben
7gegenTheben

Reputation: 81

change header position to left or below c# .NET

Can I change the position of the header attribute in a TextBox object? If I wanted it to be to the left or below instead of the default - above - is there a solution for that?

Upvotes: 0

Views: 790

Answers (2)

NoIdea123
NoIdea123

Reputation: 151

Try this:

<TextBox>
      <TextBox.Header>
           <TextBlock  Text="Your Header Text" HorizontalAlignment="Left"></TextBlock>
      </TextBox.Header>
 </TextBox>

If you mean the total position related to the TextBox, I would use a GridView with a Label as Header. Something like:

<Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <Label Grid.Column="0">Header:</Label>
        <TextBox
            Grid.Column="1"
            Text="{Binding Path=XXX}" />

Upvotes: 0

Omar Hamdan
Omar Hamdan

Reputation: 192

in your situation i think you should use the anchor to define the edges
set the Anchor to Bottom, left

Upvotes: 1

Related Questions