<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的更多相关文章

  1. 【C#/WPF】GridSplitter 分割布局,拖拽控件分隔栏以改变控件尺寸

    需求:界面由多部分控件组成,想要拖拽控件之间的分隔栏以改变尺寸. MainWindow.xaml: <Grid> <Grid.ColumnDefinitions> <Co ...

  2. WPF Demo13通知项属性+数据绑定(代码层)

    <Window x:Class="BindingDemo1.MainWindow" xmlns="http://schemas.microsoft.com/winf ...

  3. [WPF] 使用Grid与GridSplitter排版布局

    原文:[WPF] 使用Grid与GridSplitter排版布局 前言 在開發應用程式時,一個很重要的工作項目就是設計使用者介面的排版布局.WPF中所提供的Grid控制項,讓開發人員擁有將版面分割為欄 ...

  4. 【C#/WPF】限制GridSplitter分隔栏的滑动范围

    GridSplitter可以自由滑动,例如一个水平方向的分隔栏,可以从屏幕顶端滑到屏幕底端. 现在的需求是:限制GridSplitter在一定范围内滑动. 例如,现在有如下的横竖两个GridSplit ...

  5. WPF GridSplitter最好设置HorizontalAlignment和VerticalAlignment,否则不可以左右移动

    <Window x:Class="XamlTest.Window5"        xmlns="http://schemas.microsoft.com/winf ...

  6. wpf GridSplitter左右托不了或者拖拽异常

    对于水平分割线,需要将verticalAlignment属性设置为Center 对于垂直分割线,需要将horizontalAlignment属性设置为center 切记切记,不然很苦逼....

  7. WPF基础到企业应用系列6——布局全接触

    本文转自:http://knightswarrior.blog.51cto.com/1792698/365351 一. 摘要 首先很高兴这个系列能得到大家的关注和支持,这段时间一直在研究Windows ...

  8. 【源码分享】WPF漂亮界面框架实现原理分析及源码分享

    1 源码下载 2 OSGi.NET插件应用架构概述 3 漂亮界面框架原理概述 4 漂亮界面框架实现  4.1 主程序  4.2 主程序与插件的通讯   4.2.1 主程序获取插件注册的服务   4.2 ...

  9. 对比MFC资源文件谈谈WPF布局方式

    对比MFC资源文件谈谈WPF布局方式 MFC方式 对于传统的MFC基于UI的应用程序设计通常分两步走,首先是设计UI,使用的是RC文件,然后是代码文件,对RC文件进行操作,如下面Figure 1 的基 ...

随机推荐

  1. Kesci: Keras 实现 LSTM——时间序列预测

    博主之前参与的一个科研项目是用 LSTM 结合 Attention 机制依据作物生长期内气象环境因素预测作物产量.本篇博客将介绍如何用 keras 深度学习的框架搭建 LSTM 模型对时间序列做预测. ...

  2. Android Native Hook技术(二)

    Hook技术应用 已经介绍了安卓 Native hook 原理,这里介绍 hook 技术的应用,及 Cyida Substrate 框架. 分析某APP,发现其POST请求数据经过加密,我们希望还原其 ...

  3. Xposed MultiDex Hook

    使用Xposed Hook多DEX的应用时,Xposed会抛ClassNotFound的异常,原因是它只会在classes.dex查找类.以下官方不完美解决办法,参考 Github上的 #30 iss ...

  4. php-fpm高并发配置[1000+]

    Dell R430 2个物理CPU,每个CPU有6个内核: www.conf: pm = dynamic pm.max_children = 120 pm.start_servers = 8 pm.m ...

  5. FileNotFoundError: [Errno 2] No such file or directory的解决方法

    1.获取当前文件所在路径 basedir = os.path.dirname(__file__) print("basedir:" + basedir) 2.将路径进行拼接 upl ...

  6. POJ3070 Fibonacci(矩阵快速幂加速递推)【模板题】

    题目链接:传送门 题目大意: 求斐波那契数列第n项F(n). (F(0) = 0, F(1) = 1, 0 ≤ n ≤ 109) 思路: 用矩阵乘法加速递推. 算法竞赛进阶指南的模板: #includ ...

  7. 06 Listener,Filter,BeanUtils

    Listener 监听器,监听某一个事件的发生. 状态的改变. 内部机制其实就是接口回调. 接口回调  需求:A在执行循环,当循环到5的时候, 通知B.事先先把一个对象传递给 A , 当A 执行到5的 ...

  8. linqpad使用方法备忘

    1.使用EF更新数据库 void Main() { select item).ToList(); CM_BookPages.DeleteAllOnSubmit(items); SubmitChange ...

  9. MySQL Transaction--MySQL与SQL Server在可重复读事务隔离级别上的差异

    MySQL和SQL Server两种数据库在REPEATABLE-READ事务隔离级别实现方式不同,导致使用上也存在差异. 在MySQL中,默认使用REPEATABLE-READ事务隔离级别,MySQ ...

  10. The difference among ioctl, unlocked_ioctl and compat_ioctl (RT)

    Meta-answer: All the raw stuff happening to the Linux kernel goes through lkml (the Linux kernel mai ...