473,746 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MouseHover delay with PictureBox

1 New Member
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 programmaticall y 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 6505
7,872 Recognized Expert Expert
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

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, nothing happens. I have to move out of the control's perimeters and come back and wait to trigger a hover event. So, my question is : how do I tell the control that I'd like to receive a MouseHover event everytime mouse stops moving over the...
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 MouseHover does not fire again unless the mouse is moved outside the control. Is there a something I am missing or Is there a better way to do this. Thanks for any help
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
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
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 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.
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 MouseHover? Private Sub Label1_MouseHover(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.MouseHover Label1.Text = "Yo mama" End Sub
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 sec...when you press the key, it waited abt 1 sec before it make continous movement) i want the picturebox move smoothly as i press the key How can i cancel the time delay?
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 particular product and populates the picture boxes using the paths found by the stored procedure. Anyway, that part works great. I have the Picture Boxes set a 231 px wide by 231 px high, and I want to resize these in a separate box when a user hovers...
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 10 or so changes of the image there is a really long delay in updating the image. The size properties will update but the image itself stays the same. I have tried forcing it to revalidate (even though changing the size of the picturebox does this)...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.