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

相关推荐
小满Autumn2 分钟前
固高GTS运动控制卡 — C#开发完全指南
c#·.net·上位机·运动控制卡
影寂ldy18 分钟前
C# 多播委托
前端·javascript·c#
The Sheep 202326 分钟前
C#多线程学习
开发语言·学习·c#
我要打打代码1 小时前
C# 扩展方法
开发语言·c#
椒颜皮皮虾྅1 小时前
OpenVINO™ C# API 3.3 全新发布!正式接入 OpenVINO GenAI,C# 本地大模型开发全面启航!
人工智能·开源·c#·openvino
小满Autumn2 小时前
雷赛DMC运动控制卡 — C#开发完全指南
c#·.net·上位机·运动控制卡·雷赛
专注VB编程开发20年11 小时前
AI 生成C# WinForm 窗体 = 目前就是垃圾
开发语言·人工智能·c#
z落落12 小时前
C# 泛型接口和泛型类+泛型约束
开发语言·c#
阿正的梦工坊12 小时前
【Rust】08-集合类型、字符串与迭代器入门
开发语言·rust·c#