Author: Phil Klien | Posted on: 6/23/2008 12:30:42 PM | Views : 287

In the following XAML, the first two TextBoxes fill the horizontal width of the StackPanel by default.  But regardless of whether I add HorizontalAlignment="Stretch" or HorizontalContentAlignment="Stretch" attributes to the following ListBoxes, their TextBoxes will not fill the full width of the ListBox.

How can I get that effect without using fixed widths?

<StackPanel>
    <TextBox Text="abc1" />

    <Grid>
        <TextBox Text="abc2" />
    </Grid>

    <ListBox>
        <TextBox Text="abc3" />
    </ListBox>

    <ListBox>
        <Grid>
            ...

Go to the complete details ...