473,324 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Hover delay?

I want to introduce a one-second delay into the MouseHover event of a label.
In other words, I want the user to have to hover over a label for one second
before the label's MouseHover event triggers a response from the
application.

Here's what I've got so far:

-- Add a timer control and a bolean DoAction flag to the form.

-- Set DoAction flag to false and the timer for a one second interval.

-- Start the timer when the label's mouseEnter event fires.

-- When the label's MouseHover event fires, exit the event handler as long
as the DoAction flag is false.

-- When the timer fires it's interval event, set the DoAction flag to true.

The next MouseHover event will trigger the response to that event.

This approach seems more complicated than it needs to be. Is there a simpler
way to accomplish the same thing?

Thanks in advance.

--
David Veeneman
Foresight Systems
Jan 17 '06 #1
1 4618
So you keep getting MouseHover events as long as the mouse is hovering (as
opposed to just getting one MouseHover event)? I'm not intimately familiar
with how that event is fired, hence my question.

If you are getting multiple events, why bother with the timer at all. Why
not just use something like GetTickCount( ) (I'm referring to Win32 API -
whatever the c# equivalent is) and check if more than X milliseconds have
elapsed.

The timer here seems superfluous since I don't believe you need the
asynchronicity that the timer gives you.

Kevin

"David Veeneman" <da****@nospam.com> wrote in message
news:uo**************@TK2MSFTNGP15.phx.gbl...
I want to introduce a one-second delay into the MouseHover event of a
label. In other words, I want the user to have to hover over a label for
one second before the label's MouseHover event triggers a response from the
application.

Here's what I've got so far:

-- Add a timer control and a bolean DoAction flag to the form.

-- Set DoAction flag to false and the timer for a one second interval.

-- Start the timer when the label's mouseEnter event fires.

-- When the label's MouseHover event fires, exit the event handler as long
as the DoAction flag is false.

-- When the timer fires it's interval event, set the DoAction flag to
true.

The next MouseHover event will trigger the response to that event.

This approach seems more complicated than it needs to be. Is there a
simpler way to accomplish the same thing?

Thanks in advance.

--
David Veeneman
Foresight Systems

Jan 19 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: LRW | last post by:
Below I'll paste my CSS and the HTML in question. But what's happening is, I'm trying to establish a link behavior for a class that's separate from the normal link class. I've established a: 's...
12
by: Sander Tekelenburg | last post by:
Trying to make some images disappear on hover (works), and others appear on hover (works not). In tested browsers, this gives the expected result: IMG.disappear {visibility: visible}...
6
by: Michael Rozdoba | last post by:
I've had some trouble getting IE to behave in respect of applying absolute positioning to a span on an a:hover. I can get it to work, but I don't understand why certain code causes it to fail to...
1
by: Ricky | last post by:
Hi, I am trying to create this rollover bar menu with js and it works fine until it has to disappear I wanted it to disappear after the mouseout function and after a little delay but instead it...
1
by: Ian | last post by:
I'm wondering if someone can tell me what the best way to do this would be. I have a web page with a table which has some text in and I want the text size to be automatically enlarged when the...
5
by: Adriano | last post by:
hello, when i use mouseHover event on a button it delays for about 0.5 seconds before running, any ideas how to remove this delay? tnx in advance, adriano
7
by: Anthony | last post by:
Hi, I'm experiencing a delay (of about 1-2 seconds) when I try and select and item in my VB.NET windows menu. The menu item eventually appears and the program carries on as normal. But I cannot...
5
by: z | last post by:
I'm using a horizontal CSS-based dropdown menu based on this code: http://www.weblens.org/templates/sample_menu.html Is there a relatively easy way to add a slight delay to the menu with...
4
by: Sigilaea | last post by:
My previous post got squashed because m post is too long. Sorry for that: I have an AJAX page with a CSS menu at the top. My problem is the hover functionality stops working after someone clicks...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.