473,387 Members | 1,745 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,387 software developers and data experts.

MouseHover delay with PictureBox

I have recently designed a Winform Image drag & drop utility. The approach I took was to have a Panel control serve as a destination for multiple file drop. Once the user dragged & dropped the desired files I do a check to ensure that I only process the image files (".jpg", ".png", etc), while any other files are ignored by the program. For every image file being dropped I programmatically create a PictureBox control, do proper resizing of an image in question, load it into the PictureBox, and finally position the PictureBox with appropriate offset within the Panel to ensure it is nicely aligned with the rest of the PictureBox controls.

Now onto my question.... for each PictureBox control I implement a MouseHover event by means of which I am changing the color and thickness of the border for the PictureBox pointed by the mouse. I don't know why but I can't help but notice that there's a considerable delay between the time the mouse is over a given PictureBox control and the time I actually see the new border appear around it.

Has anyone here gone through similar experiences and found a workaround to eliminate this delay? I know the PictureBox is redrawn every time I mouse over it and I believe it's using GDI+ graphics object in the OnPaint() method to redraw the changes, which may account for the slowness. But is there a way of implementing the border change functionality for a PictureBox control to avoid this delay ?
Jan 28 '09 #1
1 6463
Plater
7,872 Expert 4TB
MouseHover by design, doesn't fire until the mouse has been stationary for some time.(Quote microsoft)
If you want immediate results look for MouseEnter and MouseLeave events.
(If need be you can also check out MouseMove, but the other two should be fine)
Jan 29 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Sheriff | last post by:
Receiving a single mouseHover is simple, just move the mouse over my control and wait. However, following this mouse hover event, if I move the mouse around within the control and once again wait,...
1
by: Phenix Smith | last post by:
I am working on the component and would like to change a display when the user stops moving the mouse inside the control. I used the MouseHover and MouseMove to change the status, but the...
2
by: melanieab | last post by:
Hi, How can you determine which cell the mouse is positioned over during the mousehover event? Thanks so much! Mel
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
1
by: David Veeneman | last post by:
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...
4
by: Ronald S. Cook | last post by:
I have a label on a Windows form. I have the following code which doesn't work when I mouse over the label. Any idea why? If I change MouseHover to MouseEnter it works. So, what good is...
6
by: raiden1985 | last post by:
Hi all~ I would like to ask I am doing a game project and i have to control a picturebox to move by pushing a Key (e.g. Keys.up) i used PerformClick() but there is a key delay( abt 1...
1
by: euroluxantiques | last post by:
Hi All, Using VB.Net with SQL Server. I have a form that I create a number of Picture Boxes on dynamically, based on a stored procedure that retrieves a listing of images available for a...
3
Raventara
by: Raventara | last post by:
Hi all, I have a program which will routinely update the image of a picturebox and resize the picturebox to keep the aspect ratio of the image in tact. The problem I am having is that after about...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.