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>

posted @ 2022-05-27 15:39  槑孒  阅读(313)  评论(0编辑  收藏  举报