码迷,mamicode.com
首页 > Windows程序 > 详细

WPF Demo13 GridSplitter

时间:2017-05-18 11:32:35      阅读:229      评论:0      收藏:0      [点我收藏+]

标签:src   dsp   init   pre   block   extc   str   demo1   name   

<Window x:Class="Commands.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" ResizeMode="CanResize" ShowInTaskbar="True">
    <Window.CommandBindings>
        <CommandBinding Command="Save" Executed="Save_Executed" CanExecute="Save_CanExecute"/>
        <CommandBinding Command="Close" Executed="Close_Executed" CanExecute="Close_CanExecute"/>
    </Window.CommandBindings>
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="5"/>
            <ColumnDefinition Width="2*"/>
        </Grid.ColumnDefinitions>

        <!--Background="#00000000" 透明色设置-->
        <Menu Grid.Row="0" Grid.ColumnSpan="3">
           
            <MenuItem Header="保存" Command="Save"/>
            <MenuItem Header="关闭" Command="Close"/>
        </Menu>
        
        <ToolBar Grid.Row="1" Grid.ColumnSpan="3">
            <Button>
                <Image Source="image/Copy.png"/>
            </Button>
            <Button>
                <Image Source="image/Paste.png"/>
            </Button>
            <Button>
                <Image Source="image/Cut.png"/>
            </Button>
            <Button>
                <Image Source="image/Delete.png"/>
            </Button>
        </ToolBar>
        <TextBox Grid.Row="2"   Name="txtLeft" TextChanged="txtLeft_TextChanged">
            <TextBox.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="复制" >
                        <MenuItem.Icon>
                            <Image Source="/Commands;component/image/Copy.png" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="粘贴">
                        <MenuItem.Icon>
                            <Image Source="/Commands;component/image/Paste.png" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="剪贴">
                        <MenuItem.Icon>
                            <Image Source="/Commands;component/image/Cut.png" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="删除">
                        <MenuItem.Icon>
                            <Image Source="/Commands;component/image/Delete.png" />
                        </MenuItem.Icon>
                    </MenuItem>
                </ContextMenu>
            </TextBox.ContextMenu>
        </TextBox>
        <GridSplitter Grid.Row="2"   Grid.Column="1" Width="5" Background="GhostWhite" HorizontalAlignment="Stretch" />
        <TextBlock Grid.Column="2" Grid.Row="2"  Name="txtRight" />
        <StatusBar Grid.Row="3"  Name="statusBar1"  Grid.ColumnSpan="3" >
            <StatusBarItem Content="当前状态为:" />
            <Label Content="default"/>
        </StatusBar>
    </Grid>
</Window>

技术分享

WPF Demo13 GridSplitter

标签:src   dsp   init   pre   block   extc   str   demo1   name   

原文地址:http://www.cnblogs.com/YYkun/p/6872022.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!