您的位置:首页 > 编程语言 > C#

C#禁用numericUpDown控件鼠标中键滚轮消息响应

2016-04-14 11:22 363 查看
C#禁用numericUpDown控件鼠标中键滚轮消息响应

声明一个事件

numericUpDown_roadgain.MouseWheel += new MouseEventHandler(Num_DiscountAmount_MouseWheel);


编写一个事件

private void Num_DiscountAmount_MouseWheel(object sender, MouseEventArgs e)
{
HandledMouseEventArgs h = e as HandledMouseEventArgs;
if (h != null)
{
h.Handled = true;
}
}


参考:
http://www.jb51.net/article/34559.htm
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: