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.运行结果

相关推荐
张人玉36 分钟前
c#串口读写威盟士五插针
开发语言·c#·通讯
睡前要喝豆奶粉1 小时前
在.NET Core Web Api中使用redis
redis·c#·.netcore
偶尔的鼠标人3 小时前
SqlSugar查询字符串转成Int的问题
c#·sqlsugar
我不是程序猿儿3 小时前
【C#】WinForms 控件句柄与 UI 刷新时机
开发语言·ui·c#
聪明努力的积极向上6 小时前
【C#】HTTP中URL编码方式解析
开发语言·http·c#
关关长语9 小时前
(四) Dotnet中MCP客户端与服务端交互通知日志信息
ai·c#·mcp
小码编匠9 小时前
WPF 动态模拟CPU 使用率曲线图
后端·c#·.net
聪明努力的积极向上9 小时前
【.NET】依赖注入浅显解释
c#·.net
hixiong12310 小时前
C# OpencvSharp使用lpd_yunet进行车牌检测
开发语言·opencv·计算机视觉·c#
beyond谚语12 小时前
第一章 WPF概述
wpf