473,471 Members | 1,744 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Drag & Drop Hypertext Headaches and Image Instability

I'm designing an app in Access 97 that will facilitate the uploading
of records and images to a website. The user selects the image
thumbnails from the file system and drags them into the app. There
appears to be just two types of controls that support this action: OLE
controls and Hyperlink text boxes. I am using the hyperlink. Dragging
the images into the hyperlink works just fine, but I'm quite dismayed
about the lack of control over the way the hyperlink behaves. For
instance, I have no need for the images to pop up in a browser when
clicked. The app minimizes every time and loses the focus. I couldn't
find any way of disabling this behavior.

The user really has no need of clicking the hyperlinks, unless perhaps
to delete one or more. But I wanted to have an image control to
display a thumbnail of whatever image I have clicked. (There are five
image textboxes). So since I can't control the OnEnter event the way I
wanted, I have been experimenting with the MouseMove event.

The Mouse Move event is hard to control since it fires repeatedly and
tries to render the image that I've selected. To prevent the app from
crashing, I used a variable to only let OnMouseMove fire if it needs
to render a different image. I also added a timer event to wait one
second to allow the user to make a selection. These improved the
reliability from crashing every time to just crashing every once in a
while. The app is still very unreliable this way and I can't seem to
eliminate the problem eventhough my timer and variable are working
properly.

My hunch at this point is that the image control may sometimes take
more than one or two seconds to "import" the image. This may be enough
time to have the MouseMove event fire again and eventually overload
the memory.

Does anyone know of a better solution? ... a way to drag and drop
without hyperlinks? ... a different image control that doesn't crash?

Here is some code for reference, should anyone be interested:

Private Sub imgfile1_BeforeUpdate(Cancel As Integer)
iMove = 1
If Me!imgfile1 = "" Then
Me!Image1.Picture = ""
GoTo 80
End If
istart = InStr(1, Me!imgfile1, "#")
iend = InStr(istart + 1, Me!imgfile1, "#")
On Error GoTo 70
Me![Image1].Picture = FileSystem.CurDir & "/" & Mid(Me!imgfile1,
istart + 1, iend - istart - 1)
On Error GoTo 0
GoTo 80
70 Cancel = True
MsgBox ("Images must be a .jpg or .gif format")
Me.Undo
80 End Sub

Private Sub imgfile1_MouseMove(Button As Integer, Shift As Integer, X
As Single, Y As Single)
If iMove = 1 Then GoTo 71
Call timeDelay 'I added a second time delay here. Delay before AND
delay after.
If Not IsNull(Me!imgfile1) Then
iMove = 1
istart = InStr(1, Me!imgfile1, "#")
iend = InStr(istart + 1, Me!imgfile1, "#")
strImage = FileSystem.CurDir & "/" & Mid(Me!imgfile1, istart + 1,
iend - istart - 1)
On Error Resume Next
If Me![Image1].Picture <> strImage Then Me![Image1].Picture =
strImage
On Error GoTo 0
Call timeDelay
Me!imgfile1.SetFocus
End If
71 End Sub

Public Function timeDelay()
Dim PauseTime, Start
PauseTime = 1 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
Loop
End Function
Nov 13 '05 #1
3 2190
Without even getting into your logic to load the Images(why don't you
use a CommandButton and it's Click event?) I would ask the following
question.

Do you have the "Loading Image" Dialog turned off via the Registry Key
method found here:?
http://www.mvps.org/access/api/api0038.htm

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Fred R@smussen" <TH**********@spammotel.com> wrote in message
news:65**************************@posting.google.c om...
I'm designing an app in Access 97 that will facilitate the uploading
of records and images to a website. The user selects the image
thumbnails from the file system and drags them into the app. There
appears to be just two types of controls that support this action: OLE
controls and Hyperlink text boxes. I am using the hyperlink. Dragging
the images into the hyperlink works just fine, but I'm quite dismayed
about the lack of control over the way the hyperlink behaves. For
instance, I have no need for the images to pop up in a browser when
clicked. The app minimizes every time and loses the focus. I couldn't
find any way of disabling this behavior.

The user really has no need of clicking the hyperlinks, unless perhaps
to delete one or more. But I wanted to have an image control to
display a thumbnail of whatever image I have clicked. (There are five
image textboxes). So since I can't control the OnEnter event the way I
wanted, I have been experimenting with the MouseMove event.

The Mouse Move event is hard to control since it fires repeatedly and
tries to render the image that I've selected. To prevent the app from
crashing, I used a variable to only let OnMouseMove fire if it needs
to render a different image. I also added a timer event to wait one
second to allow the user to make a selection. These improved the
reliability from crashing every time to just crashing every once in a
while. The app is still very unreliable this way and I can't seem to
eliminate the problem eventhough my timer and variable are working
properly.

My hunch at this point is that the image control may sometimes take
more than one or two seconds to "import" the image. This may be enough
time to have the MouseMove event fire again and eventually overload
the memory.

Does anyone know of a better solution? ... a way to drag and drop
without hyperlinks? ... a different image control that doesn't crash?

Here is some code for reference, should anyone be interested:

Private Sub imgfile1_BeforeUpdate(Cancel As Integer)
iMove = 1
If Me!imgfile1 = "" Then
Me!Image1.Picture = ""
GoTo 80
End If
istart = InStr(1, Me!imgfile1, "#")
iend = InStr(istart + 1, Me!imgfile1, "#")
On Error GoTo 70
Me![Image1].Picture = FileSystem.CurDir & "/" & Mid(Me!imgfile1,
istart + 1, iend - istart - 1)
On Error GoTo 0
GoTo 80
70 Cancel = True
MsgBox ("Images must be a .jpg or .gif format")
Me.Undo
80 End Sub

Private Sub imgfile1_MouseMove(Button As Integer, Shift As Integer, X
As Single, Y As Single)
If iMove = 1 Then GoTo 71
Call timeDelay 'I added a second time delay here. Delay before AND
delay after.
If Not IsNull(Me!imgfile1) Then
iMove = 1
istart = InStr(1, Me!imgfile1, "#")
iend = InStr(istart + 1, Me!imgfile1, "#")
strImage = FileSystem.CurDir & "/" & Mid(Me!imgfile1, istart + 1,
iend - istart - 1)
On Error Resume Next
If Me![Image1].Picture <> strImage Then Me![Image1].Picture =
strImage
On Error GoTo 0
Call timeDelay
Me!imgfile1.SetFocus
End If
71 End Sub

Public Function timeDelay()
Dim PauseTime, Start
PauseTime = 1 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
Loop
End Function


Nov 13 '05 #2
Stephen,
Thanks for the suggestion regarding the registry key. It would be good
to eliminate that "loading image" dialog, especially if it helps
alleviate the problem. But I would like to publish this application as
a runtime version eventually and I wouldn't know how to implement
changes to other folks registry keys. Yikes.

The command buttons would be a good alternative to the MouseMove
event. I may have to go that route.

So I guess there's no way to disable the hyperlink feature then? (I
need drag & drop, but I can do without the hyperlink onclick
behavior).

Regards,

Fred R@smussen

"Stephen Lebans" <Fo****************************************@linval id.com> wrote in message news:<fe**********************@ursa-nb00s0.nbnet.nb.ca>...
Without even getting into your logic to load the Images(why don't you
use a CommandButton and it's Click event?) I would ask the following
question.

Do you have the "Loading Image" Dialog turned off via the Registry Key
method found here:?
http://www.mvps.org/access/api/api0038.htm

--

Nov 13 '05 #3
Yes, suppressing the loading image dialog will fix your issue.

A search for Drag Drop in the Access NG's will yield several
alternatives on this subject.

There's lots of sample code out there showing how to Modify the
Registry(if you have the necessary permissions).
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Fred R@smussen" <TH**********@spammotel.com> wrote in message
news:65**************************@posting.google.c om...
Stephen,
Thanks for the suggestion regarding the registry key. It would be good
to eliminate that "loading image" dialog, especially if it helps
alleviate the problem. But I would like to publish this application as
a runtime version eventually and I wouldn't know how to implement
changes to other folks registry keys. Yikes.

The command buttons would be a good alternative to the MouseMove
event. I may have to go that route.

So I guess there's no way to disable the hyperlink feature then? (I
need drag & drop, but I can do without the hyperlink onclick
behavior).

Regards,

Fred R@smussen

"Stephen Lebans"

<Fo****************************************@linval id.com> wrote in
message news:<fe**********************@ursa-nb00s0.nbnet.nb.ca>...
Without even getting into your logic to load the Images(why don't you use a CommandButton and it's Click event?) I would ask the following
question.

Do you have the "Loading Image" Dialog turned off via the Registry Key method found here:?
http://www.mvps.org/access/api/api0038.htm

--


Nov 13 '05 #4

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

Similar topics

1
by: portraitmaker | last post by:
I found some drag and drop code on the web and modified it a little b taking out some of the stuff I didn't need. This sample allows you to drag an image in a table to another positio and swaps...
2
by: memHog | last post by:
I am trying to create a windows application that will perform drag and drop between a usercontrol on a toolbar and a "user document". As the user control is being dragged accross the user...
6
by: jojobar | last post by:
Hello, I look at the asp.net 2.0 web parts tutorial on the asp.net web site. I tried to run it under firefox browser but it did not run. If I want to use this feature in a commercial product...
3
by: Goldwind | last post by:
Hi, I"m trying to use drag & drop of text from one text box to another but without suceess. Microsoft presented an example in "101 code samples" BUT in this example the code select and drag all...
3
by: simchajoy2000 | last post by:
Hi everyone! I am currently working on a user interface project right now where I need to do something similar to how the Visual Studio interface works. In Visual Studio you can drag a button...
8
by: ericgorr | last post by:
I have the following test page: http://ericgorr.net/test.html <html> <head><title>Simple JavaScript</title></head> <BODY ondragstart="alert(event.srcElement.tagName)"> <INPUT TYPE=text...
2
by: sebastian.janoschka | last post by:
Hi, I build my first Drag & Drop with JavaScript and I would like to drag the pictures when I click on it. When I create a normal div tag with some text the script works, but when I put a...
5
by: Romulo NF | last post by:
Greetings, I´m back here to show the new version of the drag & drop table columns (original script ). I´ve found some issues with the old script, specially when trying to use 2 tables with...
3
by: Martin | last post by:
I have an application that generates a page with an embedded SVG image in it. The image (the viewport) is intentionally larger than the screen (the browser's window size). I would like to provide...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
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...
1
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...
0
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...
1
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.