0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Visual Studio / WPF > コントロール > TreeView > XAMLで定義した文字列を表示する

Last updated at Posted at 2017-04-25
動作環境
Windows 7 Pro (32bit)
Microsoft Visual Studio 2017 Community
Sublime Text 2

@ WPF 4.5入門 by 大田一希さん
No.3408 / 9985

TreeViewコントロールの使用例が紹介されている。
試してみた。

XAML
<Window x:Class="_170421_t1510_WpfDataGridComboBox.MainWindow"
        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:_170421_t1510_WpfDataGridComboBox"
        xmlns:sys="clr-namespace:System;assembly=mscorlib" 
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="525">

    <TreeView>
        <TreeViewItem Header="Item3">
            <TreeViewItem Header="Item3-1">
                <TreeViewItem Header="Item3-1-4">
                    <TreeViewItem Header="Item3-1-4-1">
                        パイ
                    </TreeViewItem>
                </TreeViewItem>
            </TreeViewItem>
        </TreeViewItem>
        <TreeViewItem Header="Item2">
            <TreeViewItem Header="Item2-7">
                <TreeViewItem Header="Item2-7-1">
                    <TreeViewItem Header="Item2-7-1-8">
                        napier
                    </TreeViewItem>
                </TreeViewItem>
            </TreeViewItem>
        </TreeViewItem>
    </TreeView>
</Window>

work.png

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?