c# wpf template ItemsPanel 简单试验

1.概要

2.代码

复制代码
<Window x:Class="WpfApp2.Window9"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApp2"
        mc:Ignorable="d"
        Title="Window9" Height="450" Width="800">
    <Grid>
        <ListBox>
            <!--ItemsPanel-->
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Horizontal"/>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <!--条目-->
            <TextBlock Text="Allan"/>
            <TextBlock Text="Kevin"/>
            <TextBlock Text="Drew"/>
            <TextBlock Text="Timothy"/>
        </ListBox>
    </Grid>
</Window>

3.运行结果

相关推荐
曹牧6 小时前
C#:窗体构造函数无法引用窗体控件
开发语言·c#
iAkuya6 小时前
(leetcode)力扣100 54实现Trie树
算法·leetcode·c#
xb11326 小时前
C#使用Cancellation来取消异步任务
开发语言·c#
m0_748229996 小时前
C与C#:编程语言的核心差异解析
c语言·开发语言·c#
m0_748229996 小时前
Laravel7.x核心特性全解析
c语言·数据库·c#
阿蒙Amon7 小时前
C#每日面试题-Task和Thread的区别
java·面试·c#
码界奇点8 小时前
基于eBPF技术的高性能网络防火墙系统设计与实现
开发语言·网络·毕业设计·php·wpf·go语言·源代码管理
ytttr8738 小时前
C#实现海康威视智能车牌识别
开发语言·c#
bubiyoushang8889 小时前
C#开发的TCP/UDP网络调试助手
tcp/ip·udp·c#
PfCoder11 小时前
C# 中的定时器 System.Threading.Timer用法
开发语言·c#