屏蔽系统的Ctrl+c/x/v操作
2024-08-29 13:55:53
实现效果:
知识运用:
KeyEventArgs类的Control,
public bool Control {get;} //获取一个值 该值指示是否曾按下Ctrl键
KeyCode和Handled属性
实现代码:
private void richTextBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.C)
{
e.Handled = true;
MessageBox.Show("Ctrl+C组合键已经被屏蔽","温馨提示");
}
if (e.Control && e.KeyCode == Keys.V)
{
e.Handled = true;
MessageBox.Show("Ctrl+V组合键已经被屏蔽", "温馨提示");
}
if (e.Control && e.KeyCode == Keys.X)
{
e.Handled = true;
MessageBox.Show("Ctrl+X组合键已经被屏蔽", "温馨提示");
}
}
最新文章
- performSelector和performSelectorInBackground
- POJ1129Channel Allocation[迭代加深搜索 四色定理]
- php加速运行优化
- LANDR:在线母带处理
- win7IIS错误修改路径最全的
- 修改sqlserver2008中表的schema
- JavaScript和php常用语法——切割字符串
- CSS3秘笈复习:第六章
- stl_container容器和std_algorithm算法相同的函数
- 跨域请求携带cookie
- cf934C. A Twisty Movement(思维题)
- 理解SQL的左连接与右连接
- 【猿分享第10期】微信小程序Meetup扫盲专场回顾(转载)
- SpringBoot-@PathVariable
- domino server端的Notes.ini详解
- Solutions_issues in pip
- Lucene系列四:Lucene提供的分词器、IKAnalyze中文分词器集成、扩展 IKAnalyzer的停用词和新词
- Approximate Inference
- 【转】C#调用WebService实例和开发
- MvcForum中文版+PostgreSql源码下载