如何禁用numericupdown事件触发? [英] How to disable the numericupdown event firing?

查看:137
本文介绍了如何禁用numericupdown事件触发?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


一个可能是愚蠢的问题...


有没有人知道热,以避免如果一个人按住鼠标一个

箭头的numericUpDown它继续触发事件(它使用

显然是一个计时器)?


我想要1个事件每次点击,没有计时器激活。我已尝试在处理程序中使用禁用但是没有工作的



有什么想法吗?


tommaso

Hello,

A probably dumb question...

does anyone know hot to avoid that if one keep the mouse pressed on an
arrow of the numericUpDown it continues to fire events (it uses
evidently a timer) ?

I want 1 event for each click, and no timer activation. I have tried
using disable within the handler but does not work.

Any idea?

tommaso

推荐答案

我假设您不希望SelectedIndexChanged事件只触发

一次?为什么不在Form'的类中创建一个Boolean属性,并且

使用MouseDown和MouseUp事件操作它以指示鼠标按钮的

状态。然后SelectedIndexChanged事件可以检查

这个属性,如果设置,退出。

I assume you do not want the SelectedIndexChanged event to only fire
once? Why not create a Boolean property in the Form''s class, and
manipulate it with the MouseDown and MouseUp events to indicate the
state of the mousebutton. Then the SelectedIndexChanged event can check
this property and if set, exit.


嗨!

感谢您的回复。

检查鼠标事件是不行的,恕我直言,因为鼠标可以点击

箭头,除非知道如何检测到(?)。


(我不确定你的意思是SelectedIndexChanged:我正在使用VB

2005而且我没有有这个事件的NumericUpDown。也许你

意味着另一个控制......)。


还有其他想法吗?


-tommaso

hi!
thanks for the reply.
Checking mouse event can''t do it, IMHO, as the mouse can ble clicked
out of the arrows, unless one knows how to detect that (?).

(I am not sure what you mean by "SelectedIndexChanged ": I am using VB
2005 and I do not have this event for the "NumericUpDown". Perhaps you
meant another control...).

Any other ideas?

-tommaso


我正在谈论数字

updown控件的MouseUp和MouseDown事件,只有当您点击数字更新时才会触发

控制按钮。

I was talking aout the MouseUp and MouseDown events for the numeric
updown control, which fire ONLY when you click on the numeric updown
controls buttons.


这篇关于如何禁用numericupdown事件触发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆