WPF 组合快捷键(Ctrl+C)
页面程序:
<Window x:Class="WpfDataGrid.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Window.Resources>
<RoutedUICommand x:Key="btnClick" Text="Button Click"/>
</Window.Resources>
<Window.InputBindings>
<KeyBinding Gesture="Ctrl+C" Key="C" Command="{StaticResource btnClick}"/>
</Window.InputBindings>
<Window.CommandBindings>
<CommandBinding Command="{StaticResource btnClick}"
CanExecute="CommandBinding_CanExecute"
Executed="CommandBinding_Executed"/>
</Window.CommandBindings>
<Grid>
<Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="105,76,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />
</Grid>
</Window>
后台代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace WpfDataGrid
{
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
MainWindow main = new MainWindow();
main.ShowDialog();
}
private void CommandBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e)
{
e.CanExecute = true;
}
private void CommandBinding_Executed(object sender, ExecutedRoutedEventArgs e)
{
button1_Click(this, null);
}
}
}
WPF 组合快捷键(Ctrl+C)的更多相关文章
- WPF 组合快捷键
if(e.KeyStates == Keyboard.GetKeyStates(Key.F4) && Keyboard.Modifiers == ModifierKeys.Alt) { ...
- 使用js 设置组合快捷键
使用js 设置组合快捷键 使用js设置快捷键的本质就是获得你要设置的这个键的keyCode 的值,如果要加ctrl,alt,shift,那么就添加一个ctrlkey,altKey,shiftKey来判 ...
- linux清除全屏快捷键(Ctrl+L)
Linux用户基本上都习惯使用clear命令或Ctrl+L组合快捷键来清空终端屏幕.这样做其实并没有真正地清空屏幕,但当用鼠标向上滚时,你仍然能看到之前的命令操作留下来的输出.
- PhpStorm 快捷键大全 PhpStorm 常用快捷键和配置+如何关闭快捷键ctrl+alt+方向键旋转屏幕
如果映射的是eclipse的快捷键,又同时安装了英特尔的GPU软件,那么会有这个快捷键冲突 就是快速复制快捷键:ctrl+alt+方向键 会调用英特尔旋转屏幕,禁用掉即可 PhPStorm 是 Je ...
- WPF/C# 快捷键 自动生成方法
原文:WPF/C# 快捷键 自动生成方法 这一篇文章会很短~ 在写依赖属性的会后 propdb 会自动生成依赖属性所有的内容 但是如果我写属性变化通知的时候 希望有一个快捷键能自动生成方法 怎 ...
- PHPstorm快捷键Ctrl + Alt + Left 或Right不起作用
最近遇到一个问题,就是安装的phpstorm的回撤快捷键不起作用了,死活用不了!折磨了好久,终于找到解决方法了,具体请看我的github文章: 快捷键Ctrl + Alt + Left 或Right不 ...
- Eclipse快捷键大全,导包快捷键:ctrl+Shift+/【转】
Ctrl+Shift+L 显示所有快捷键 Ctrl+1 快速修复(最经典的快捷键,就不用多说了)Ctrl+D: 删除当前行 Ctrl+Alt+↓ 复制当前行到下一行(复制增加)Ctrl+Alt+↑ 复 ...
- Intellij IDEA 自动清除无效 import 和 清除无效 import 的快捷键 ctrl+alt+o
快捷键 ctrl+alt+o 自动清除的配置方法 可以settings-general-auto import-java项,勾选optimize imports on the fly,在当前项目下会自 ...
- 显示隐藏火车头快捷键Ctrl+t
今天ytkah在使用火车头的时候也使用了Photoshop,用了组合键Ctrl+t来进行调整图层的大小,可能多按了几次的缘故吧,触发了火车头的隐藏老板键,找了半天也找到,因为当时编辑的任务还没保存,不 ...
随机推荐
- libqrencode生成二维码
在生成二维码的库中QREncoder最为常见,但是由于中文字符的特殊性,生成中文的时候会出现一定的错误,所以博主改用libqrencode,是一个纯C编写的类库,支持面也更广泛. ① 下载libqre ...
- 这两年在QQGame写过的游戏(2012.7.15-2014.8.25)
[雷电] Gamebryo http://qqgamecdnimg.qq.com/help/rule177.html [英雄杀] http://yxs.qq.com ...
- 浅谈C语言中结构体的初始化
转自:http://www.jb51.net/article/37246.htm <代码大全>建议在变量定义的时候进行初始化,但是很多人,特别是新人对结构体或者结构体数组定义是一般不会初始 ...
- hdu4632 Palindrome subsequence (区间dp)
题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=4632 题意:求回文串子串的的个数. 思路:看转移方程就能理解了. dp[i][j] 表示区 ...
- UVA 12544 - Beehives O(nm) 无向图最小环
Bees are one of the most industrious insects. Since they collect nectarand pollen from flowers, they ...
- 怎样上传网页到ftp中
1.下载filezilla软件软件并安装 打开刚刚装好的FileZilla,点击菜单中的"文件" 2.点击站点管理器 3.点击新站点
- HTML5 标签audio添加网页背景音乐代码
<head> <meta http-equiv="Content-Type" name="viewport" content="wi ...
- Unity Lightmap动态加载研究
什么情况下需要Lightmap? 移动平台上目前暂时还不能开实时光影效果,会卡成幻灯片.所以就需要将光影烘焙到贴图上. 什么情况下需要动态加载Lightmap? 1.当项目抛弃了Unity的多场景模式 ...
- docker 配置文件引发的问题
好久没有配置 vmware / harbor 了,突然间来了兴趣,结果让我失望了,登陆反复的被refused; 这个是配置文件地址:https://github.com/vmware/harbor/b ...
- iOS tableview删除多余的空cell
self.tableview.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; 加一句这个,然后给tableview一个背景色, ...