첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170

TestProject.zip
다운로드

▶ MainWindow.xaml

<Window x:Class="TestProject.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Width="800"
    Height="600"
    Title="ListBox 엘리먼트 : SelectionMode 속성 사용하기"
    FontFamily="나눔고딕코딩"
    FontSize="16">
    <Grid>
        <Grid
            HorizontalAlignment="Center"
            VerticalAlignment="Center">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Row="0" Grid.Column="0"
                Margin="10">
                <Bold>SelectionMode : Single</Bold>
            </TextBlock>
            <ListBox Grid.Row="1" Grid.Column="0"
                Margin="10"
                Width="200"
                Height="300"
                SelectionMode="Single">
                <ListBoxItem>항목01</ListBoxItem>
                <ListBoxItem>항목02</ListBoxItem>
                <ListBoxItem>항목03</ListBoxItem>
                <ListBoxItem>항목04</ListBoxItem>
                <ListBoxItem>항목05</ListBoxItem>
                <ListBoxItem>항목06</ListBoxItem>
                <ListBoxItem>항목07</ListBoxItem>
                <ListBoxItem>항목08</ListBoxItem>
                <ListBoxItem>항목09</ListBoxItem>
                <ListBoxItem>항목10</ListBoxItem>
            </ListBox>
            <TextBlock Grid.Row="0" Grid.Column="1"
                Margin="10">
                <Bold>SelectionMode : Multiple</Bold>
            </TextBlock>
            <ListBox Grid.Row="1" Grid.Column="1"
                Margin="10"
                Width="200"
                Height="300"
                SelectionMode="Multiple">
                <DockPanel>
                    <Image Source="IMAGE/cat.png"/>
                    <TextBlock
                        Margin="10 0 0 0"
                        VerticalAlignment="Center">
                        CAT
                    </TextBlock>
                </DockPanel>
                <DockPanel>
                    <Image Source="IMAGE/dog.png"/>
                    <TextBlock
                        Margin="10 0 0 0"
                        VerticalAlignment="Center">
                        DOG
                    </TextBlock>
                </DockPanel>
                <DockPanel>
                    <Image Source="IMAGE/fish.png"/>
                    <TextBlock
                        Margin="10 0 0 0"
                        VerticalAlignment="Center">
                        FISH
                    </TextBlock>
                </DockPanel>
            </ListBox>
        </Grid>
    </Grid>
</Window>
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요