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 3 2183
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
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
--
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
-- This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
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...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
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...
|
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...
|
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...
|
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)...
| |