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

相关推荐
Xin_ye100861 小时前
C# 零基础到精通教程 - 第七章:面向对象编程(入门)——类与对象
开发语言·c#
rockey6271 小时前
AScript异步执行与await关键字
c#·.net·script·eval·expression·异步执行·动态脚本
程序leo源3 小时前
Qt窗口详解
开发语言·数据库·c++·qt·青少年编程·c#
枫叶林FYL3 小时前
项目九:异步高性能爬虫与数据采集中枢 —— 基于 Crawl<sub>4</sub>AI 与 Playwright 的现代化数据采集平台 项目总览
爬虫·python·深度学习·wpf
月巴月巴白勺合鸟月半7 小时前
质本洁来还洁去,强于污淖陷文本
c#
Xin_ye100868 小时前
C# 零基础到精通教程 - 第八章:面向对象编程(进阶)——继承与多态
开发语言·c#
她说彩礼65万8 小时前
WPF 多值转换器
wpf
asdzx679 小时前
使用 C# 打印 Excel 文档(详细教程)
c#·excel
伽蓝_游戏11 小时前
第四章:AssetBundle 核心机制与文件结构
unity·c#·游戏引擎·游戏程序
2501_9307077811 小时前
使用C#代码拆分 PowerPoint 演示文稿
开发语言·c#·powerpoint