当前位置:编程学习 > asp >>

WPF(ContentControl和ItemsControl)

<Window x:Class="TestOfContentControl.MainWindow" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        Title="MainWindow" Height="350" Width="525"> 
    <StackPanel> 
        <Button Margin="5" > 
            <TextBlock Text="Hello" /> 
        </Button> 
         
        <Button Margin="5" > 
            <Image Source="j.png" Width="30" Height="30" /> 
        </Button> 
         
        <GroupBox Margin="10" BorderBrush="Gray" > 
            <GroupBox.Header> 
                <Image Source="j.png" Width="20" Height="20" /> 
            </GroupBox.Header> 
             
            <TextBlock TextWrapping="WrapWithOverflow" Margin="5"  
                       Text="一棵树,一匹马,一头大象和一只鸡在一起,打一种日常用品。"/> 
        </GroupBox> 
    </StackPanel> 
</Window> 

<Window x:Class="TestOfContentControl.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <StackPanel>
        <Button Margin="5" >
            <TextBlock Text="Hello" />
        </Button>
       
        <Button Margin="5" >
            <Image Source="j.png" Width="30" Height="30" />
        </Button>
       
        <GroupBox Margin="10" BorderBrush="Gray" >
            <GroupBox.Header>
                <Image Source="j.png" Width="20" Height="20" />
            </GroupBox.Header>
           
            <TextBlock TextWrapping="WrapWithOverflow" Margin="5"
                       Text="一棵树,一匹马,一头大象和一只鸡在一起,打一种日常用品。"/>
        </GroupBox>
    </StackPanel>
</Window>
[html] view plaincopyprint?
<Window x:Class="TestOfItemsControl.MainWindow" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        Title="MainWindow" Height="350" Width="525"> 
 
    <StackPanel> 
        <ListBox Margin="5" > 
            <CheckBox x:Name="checkBoxTim" Content="Tim" /> 
            <CheckBox x:Name="checkBoxTom" Content="Tom" /> 
            <CheckBox x:Name="checkBoxBruce" Content="Bruce" /> 
            <Button x:Name="buttonMess" Content="Mess" /> 
            <Button x:Name="buttonOwen" Content="Owen" /> 
            <Button x:Name="buttonVictor" Content="Victor" Click="buttonVictor_Click"/> 
        </ListBox> 
        <ListBox x:Name="empLists" >          
        </ListBox> 
    </StackPanel>   
</Window> 

<Window x:Class="TestOfItemsControl.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">

    <StackPanel>
        <ListBox Margin="5" >
            <CheckBox x:Name="checkBoxTim" Content="Tim" />
            <CheckBox x:Name="checkBoxTom" Content="Tom" />
            <CheckBox x:Name="checkBoxBruce" Content="Bruce" />
            <Button x:Name="buttonMess" Content="Mess" />
            <Button x:Name="buttonOwen" Content="Owen" />
            <Button x:Name="butto

补充:Web开发 , ASP.Net ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,