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

相关推荐
电商api接口开发9 小时前
ASP.NET MVC 入门指南
c#·asp.net·mvc
我不是程序猿儿10 小时前
[C#]反射的实战应用,实际数据模拟
开发语言·c#
爱编程的鱼11 小时前
C# 结构(Struct)
开发语言·人工智能·算法·c#
是阿根11 小时前
unity使用iTextSharp生成PDF文件
unity·c#·游戏引擎
ABAP 成12 小时前
.NET Framework 4.0可用EXCEL导入至DataTable
c#
WineMonk15 小时前
C#多线程访问资源
c#
Bardb15 小时前
04-stm32的标准外设库
stm32·c#
风,停下16 小时前
C#基于Sunnyui框架和MVC模式实现用户登录管理
设计模式·c#·mvc
钢铁男儿16 小时前
C# 实战_RichTextBox选中某一行条目高亮,离开恢复
开发语言·c#
千叶真尹18 小时前
【无标题】
c#·linq