473,804 Members | 3,174 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MouseDown, MouseUp, Timing and Threading

I'm working on an application that manages large image files (mulit-page
..Tiff's to be exact some 1000+ pages).

I've written an user control that displays a number of the images as
thumbnails in a scrollable window. The user can select and modify Images
from my thumbnail control. I need to let the user re-arrange the images if
they are out of order. I need the user to be able to click on a thumbnail or
multiple and DRAG them to the correct position, BUT I don't just want
erroneous clicking and barley moving the mouse to do the re-order. On Event
MouseDown I capture the selected image(s) in a array, then pop off a new
thread that waits 1 second before it sets a Bool that allows re-ordering,
and displays a blinky thing to show where the re-order is going to go. On
Event MouseMove I just change the position of the blinkything (if needed) to
reflect the position of where it's going to go. On Event MouseUp if the
timer has gone long enough (one second) and it's in a new position then I
re-order...

Here's my problem. When a user MousesDown, in another part of the app, a
full size-image gets loaded and displayed(only one page); now if I'm loading
a big 300dpi grayscale image, it takes over a second. So on these large
images, when a user MouseDowns, moves the mouse, and then MouseUps in under
the time it takes the large image to load, the MouseUp event doesn't happen
until it loads (which is over a second) so it assumes the user meant to move
no matter what, which really messes things up.

I'm writing this control to be used by others, and telling them to work
around this is unacceptable. Is there a way to have the MouseUp event
handled in separate Thread so that the large processing time doesn't break
my control? or some other ingenious way to do this? :) I understand that the
built-in Drag-Drop events also happen in the same thread so I'm pretty sure
that wouldn't help me, and I don't need to worry about stuff being dragged
into/out of my control.
Jul 21 '05 #1
1 1695
Hi Jeremy,

I'm not sure I fully understand what you are saying - the 'in another part
of the app, a
full size-image gets loaded' part - but I wonder whether it might be easier to
do the image loading in a different thread rather than trying to MouseUp in a
different thread?

Another curiousity - is this large-image loadingh part of your drag-n-drop
rearranging? If not, perhaps you could simply not allow a drag to be initiated
until the load has finshed?

Regards,
Fergus
Jul 21 '05 #2

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

Similar topics

4
4358
by: Colin McGuire | last post by:
Hi again, thanks everyone for your previous help. But having resolved past problems, I'm moving on to new problems :( This one is a simple winforms application with two buttons, named Button1 and Button2, on it (code below). When I press the mouse button over Button2, and don't release it, in the IDE output window it prints "Button2_MouseDown" only. If I release the mouse button over the button, over the form, or even over ANY other...
1
2797
by: Alan | last post by:
i have a form with a label on it Private Sub Label1_mousedown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseDown ' do stuff End Sub Private Sub Label1_mouseup(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseUp
1
371
by: Jeremy Robertson | last post by:
I'm working on an application that manages large image files (mulit-page ..Tiff's to be exact some 1000+ pages). I've written an user control that displays a number of the images as thumbnails in a scrollable window. The user can select and modify Images from my thumbnail control. I need to let the user re-arrange the images if they are out of order. I need the user to be able to click on a thumbnail or multiple and DRAG them to the...
1
5223
by: JDeats | last post by:
It appears the WinForm MouseDown and MouseUp event handlers are not working properly. In the "bare bones" sample application below, Form1_MouseUp gets called even through the mouse button remains pressed while dragging the Form window to resize it. Can this "problem" be explained as some sort of by-design behavior? If so what is the work around to detecting when a user has completed resizing a Windows Form by way of mouse drag? / ...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10320
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,...
0
10077
tracyyun
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...
1
7620
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6853
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();...
0
5521
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...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2991
bsmnconsultancy
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.