我想实现点击键盘的ctrl键,同时鼠标点击label控件,才能实现事件响应,该如何实现,求大神指点.
解决方案 »
- C#怎么使用API函数禁用系统热键
- udp服务端的效率
- WinCE(C#)中Directory.GetFiles(DirFullPath, "*.*", SearchOption.TopDirectoryOnly)
- 关于一个SQL语句
- 有没有水晶报表的资料
- 高分求助:未处理的“System.ArithmeticException”类型的异常我运行了visual studio.net2003
- 串口数据读取缺失??
- 线程监听问题
- 使用[DllImport("GDI32.DLL")],报告说DllImport找不到或是没有using....
- 帮忙看看这个问题:远程处理程序遇到的问题
- 请问在sql server中怎么进行字段的关联
- C# winform 导入导出EXCEL的问题,求各位高手帮帮忙谢谢
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
bool d = false;
public Form1()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
if (d)
{
MessageBox.Show("", "", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
} } private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyValue == 17)
d = true; }
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
bool d = false;
public Form1()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
if (d)
{
MessageBox.Show("", "", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
} } private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyValue == 17)
d = true; } private void Form1_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyValue == 17)
d = false ;
}
}
}
private void label1_Click(object sender, EventArgs e)
{
if(ModifierKeys == Keys.Control) MessageBox.Show("");
}