WPF-控件-将ListBox条目水平排列

    <Grid Margin="6">

        <ListBox>

            <!--ItemsPanel-->

            <ListBox.ItemsPanel>

                <ItemsPanelTemplate>

                    <StackPanel Orientation="Horizontal"></StackPanel>

                </ItemsPanelTemplate>

            </ListBox.ItemsPanel>

            <TextBlock Text="Allan"/>

            <TextBlock Text="Kevin"/>

            <TextBlock Text="Drew"/>

            <TextBlock Text="Timothy"/>

        </ListBox>

    </Grid>

你可能感兴趣的:(listbox)