473,394 Members | 2,031 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,394 software developers and data experts.

Disable Double-Click?

I have an app (A2000) where I am letting the user move an object on the
screen. I use the OnClick for a command button event to modify the object's
Top (or Left) properties, but you can only click slowly. That is, every
other click is ignored, because Access is seeing a double click event. I
would put the same code there, except I'm also using the SHIFT key (during
mouse click) to cause bigger moves, and there's no SHIFT flag for the
OnDoubleClick event.

Can anyone see a way around this? Something with OnKeyPress? Haven't
played around there yet. If I could get to the double-click timing on the
PC's mouse properties... hmmm, I don't think I'd want to mess with that.
I've tried to simulate drag-n-drop, but it's pretty cheesy. And I like to
be able to control the exact move increments, to help with object alignment
(sort of snap-to-invisible-grid).
Jul 27 '06 #1
9 7997
My recollection was that if you had both Click and DoubleClick events, the
(Single) Click event would fire prior to the Double Click. I just tried that
to refresh my memory and that is exactly what happened; then I simply
removed the code from the DoubleClick event, and double clicked -- only the
Click event fired.

"Way around _what_", specifically? Sounds to me you may want to use control
panel and settings to change the interval between clicks for double click.
Or put in an empty DoubleClick event.

Larry Linson
Microsoft Access MVP

"Armando" <ar*****@bogus.comwrote in message
news:cE***************@news1.epix.net...
>I have an app (A2000) where I am letting the user move an object on the
screen. I use the OnClick for a command button event to modify the
object's Top (or Left) properties, but you can only click slowly. That is,
every other click is ignored, because Access is seeing a double click
event. I would put the same code there, except I'm also using the SHIFT
key (during mouse click) to cause bigger moves, and there's no SHIFT flag
for the OnDoubleClick event.

Can anyone see a way around this? Something with OnKeyPress? Haven't
played around there yet. If I could get to the double-click timing on the
PC's mouse properties... hmmm, I don't think I'd want to mess with that.
I've tried to simulate drag-n-drop, but it's pretty cheesy. And I like to
be able to control the exact move increments, to help with object
alignment (sort of snap-to-invisible-grid).

Jul 27 '06 #2
A "way around" the missed mouse clicks. Even though I know why it's
happening, it might appear to the user that something's not working right.
I put in an empty event for double-click, and it still stutters (a promising
suggestion though). As for getting into Control Panel to mess with the
mouse settings, I wasn't sure I could do that from within Access (can't ask
the user to do that), or if I even wanted to go there at all.

I'm prepared to be satisfied with the way it's working now - the user won't
have to come back to this screen very often once the design is done. Just
my inner perfectionist nagging me.

Thanks!

"Larry Linson" <bo*****@localhost.notwrote in message
news:j0cyg.9035$V74.2060@trnddc08...
My recollection was that if you had both Click and DoubleClick events, the
(Single) Click event would fire prior to the Double Click. I just tried
that to refresh my memory and that is exactly what happened; then I simply
removed the code from the DoubleClick event, and double clicked -- only
the Click event fired.

"Way around _what_", specifically? Sounds to me you may want to use
control panel and settings to change the interval between clicks for
double click. Or put in an empty DoubleClick event.

Larry Linson
Microsoft Access MVP

"Armando" <ar*****@bogus.comwrote in message
news:cE***************@news1.epix.net...
>>I have an app (A2000) where I am letting the user move an object on the
screen. I use the OnClick for a command button event to modify the
object's Top (or Left) properties, but you can only click slowly. That
is, every other click is ignored, because Access is seeing a double click
event. I would put the same code there, except I'm also using the SHIFT
key (during mouse click) to cause bigger moves, and there's no SHIFT flag
for the OnDoubleClick event.

Can anyone see a way around this? Something with OnKeyPress? Haven't
played around there yet. If I could get to the double-click timing on
the PC's mouse properties... hmmm, I don't think I'd want to mess with
that. I've tried to simulate drag-n-drop, but it's pretty cheesy. And I
like to be able to control the exact move increments, to help with object
alignment (sort of snap-to-invisible-grid).


Jul 28 '06 #3
On Thu, 27 Jul 2006 20:48:08 GMT, "Armando" <ar*****@bogus.comwrote:

I understand you have a UI in which the user can move a button by
slowly clicking on it.
An alternative design would be:
- user selects the Move mode
- user selects the button to move, by clicking it. Button indicates
its selected state, perhaps by changing the text color.
- user interacts with 4 up, down, left, right buttons on a control
panel. You can even use AutoRepeat=Yes allowing the user to keep the
button depressed so the selected button continues to move in that
direction.

Indulge me: why are you providing this functionality?

-Tom.

>I have an app (A2000) where I am letting the user move an object on the
screen. I use the OnClick for a command button event to modify the object's
Top (or Left) properties, but you can only click slowly. That is, every
other click is ignored, because Access is seeing a double click event. I
would put the same code there, except I'm also using the SHIFT key (during
mouse click) to cause bigger moves, and there's no SHIFT flag for the
OnDoubleClick event.

Can anyone see a way around this? Something with OnKeyPress? Haven't
played around there yet. If I could get to the double-click timing on the
PC's mouse properties... hmmm, I don't think I'd want to mess with that.
I've tried to simulate drag-n-drop, but it's pretty cheesy. And I like to
be able to control the exact move increments, to help with object alignment
(sort of snap-to-invisible-grid).
Jul 28 '06 #4
Armando wrote:
I have an app (A2000) where I am letting the user move an object on the
screen. I use the OnClick for a command button event to modify the object's
To do this I use the MouseDown Event as follows:

Private Sub lblSpeedControl_MouseDown(Button As Integer, Shift As
Integer, X As Single, Y As Single)
Dim NewTop As Single
Dim pY As Single
Dim pX As Single
Dim c As Single
Dim p As POINTAPI
Dim r As Single
Dim t As Long
t = lblSpeedControl.Top
If Button = acLeftButton Then
GetCursorPos p
pX = p.X
pY = p.Y
With lblSpeedControl
Do While Not CBool(GetQueueStatus(QS_MOUSEBUTTON))
GetCursorPos p
SetCursorPos pX, p.Y
NewTop = t + (p.Y - pY) / mPixelsPerTwipVerticalFactor
If NewTop < mMinTop Then
If .Top <mMinTop Then
.Top = mMinTop
SpeedControlColor
Me.Repaint
If mMinTop - NewTop 28 Then Exit Do
End If
ElseIf NewTop mMaxBottom Then
If .Top <mMaxBottom Then
.Top = mMaxBottom
SpeedControlColor
Me.Repaint
If NewTop - mMaxBottom 28 Then Exit Do
End If
Else
.Top = NewTop
SpeedControlColor
Me.Repaint
End If
Loop
End With
SetCrementInterval lblSpeedControl.Top / mMaxBottom
End If
End Sub

Of course this calls other functions, but perhaps you can get the idea.
The Double Click never comes into play here, as
GetQueueStatus(QS_MOUSEBUTTON) monitors any change (such as releasing
the left button) and stops dragging the control.

Jul 28 '06 #5
Indulge me: why are you providing this functionality?

Butting in ... I use it to move a (vba/api only) slider; the slider
controls the speed at which my calendar moves from month to month, year
to year, when its buttons are pressed. We are likely to want it to be
fast if we are moving a long way, slow if we are being precise; or we
may simply have a personal preference.

Jul 28 '06 #6
Hi Tom -

For your indulgence: I'm using EIGHT buttons to move and size rectangles
which represent the arrangement of real-world items, which are managed one
at a time by clicking on them (in non-design mode).

To your suggestion - AutoRepeat sounds pretty good. I just tried it, and
the new location doesn't display until the mouse is released. But it DOES
keep moving while pressed, you just have to let go to see how far. This
might be acceptable, it's one of the better ideas so far.

Thanks for your interest,

Armando
Jul 29 '06 #7
Lyle -
I'll have to absorb this for a bit, looks interesting.
Thanks,
Armando
"Lyle Fairfield" <ly***********@aim.comwrote in message
news:11********************@75g2000cwc.googlegroup s.com...
Armando wrote:
>I have an app (A2000) where I am letting the user move an object on the
screen. I use the OnClick for a command button event to modify the
object's

To do this I use the MouseDown Event as follows:

Private Sub lblSpeedControl_MouseDown(Button As Integer, Shift As
Integer, X As Single, Y As Single)
Dim NewTop As Single
Dim pY As Single
Dim pX As Single
Dim c As Single
Dim p As POINTAPI
Dim r As Single
Dim t As Long
t = lblSpeedControl.Top
If Button = acLeftButton Then
GetCursorPos p
pX = p.X
pY = p.Y
With lblSpeedControl
Do While Not CBool(GetQueueStatus(QS_MOUSEBUTTON))
GetCursorPos p
SetCursorPos pX, p.Y
NewTop = t + (p.Y - pY) / mPixelsPerTwipVerticalFactor
If NewTop < mMinTop Then
If .Top <mMinTop Then
.Top = mMinTop
SpeedControlColor
Me.Repaint
If mMinTop - NewTop 28 Then Exit Do
End If
ElseIf NewTop mMaxBottom Then
If .Top <mMaxBottom Then
.Top = mMaxBottom
SpeedControlColor
Me.Repaint
If NewTop - mMaxBottom 28 Then Exit Do
End If
Else
.Top = NewTop
SpeedControlColor
Me.Repaint
End If
Loop
End With
SetCrementInterval lblSpeedControl.Top / mMaxBottom
End If
End Sub

Of course this calls other functions, but perhaps you can get the idea.
The Double Click never comes into play here, as
GetQueueStatus(QS_MOUSEBUTTON) monitors any change (such as releasing
the left button) and stops dragging the control.

Jul 29 '06 #8
On Sat, 29 Jul 2006 04:40:08 GMT, "Armando" <ar*****@bogus.comwrote:

Put a DoEvents in the event, and it should repaint each time.
-Tom.

>Hi Tom -

For your indulgence: I'm using EIGHT buttons to move and size rectangles
which represent the arrangement of real-world items, which are managed one
at a time by clicking on them (in non-design mode).

To your suggestion - AutoRepeat sounds pretty good. I just tried it, and
the new location doesn't display until the mouse is released. But it DOES
keep moving while pressed, you just have to let go to see how far. This
might be acceptable, it's one of the better ideas so far.

Thanks for your interest,

Armando
Jul 29 '06 #9
Tom -

[AutoRepeat with DoEvents] is the PERFECT solution! It allows a single
click before the repeat happens (for small moves) and the repeat takes care
of large moves, so I don't have to check for SHIFT anymore.

A thousand thanks, this one is solved.
Jul 30 '06 #10

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

Similar topics

5
by: JML | last post by:
Hi guys, I need HELP I am trying to disable submit button after user submits the form. thanks in advance --
5
by: Bob Bedford | last post by:
I create checkboxes using datas from a database (with PHP). I store all values in an array, as I must pass this value like a Form value. Now, in some cases, when a checkbox is selected, I must...
2
by: MT | last post by:
Hi, I am currently validating an XML file against a Schema using XMLValidatingReader. The schema actually contains ranges for particular elements and I have been using it to detect range errors...
0
by: John Grandy | last post by:
On a .aspx page I have seen commercial controls that serve as replacements for the <asp:Button> control that immediately disable the button on form submission so that accidental double-clicks (or...
4
by: Chris | last post by:
I have an asp.net page say page1.aspx. The form in html code is <form id = "Form1"> And i want to disable all the fields of the form after some code steps. I had created a javascript funct: ...
2
by: ibiza | last post by:
Hi all, I have a quite big webform that has about ~15 validators. I found, after having looked at the generated HTML source, that the filesize is pretty big : about 65KB. Then, I added to every...
2
by: Ryan Liu | last post by:
In C#, for a large float (9 digitals), how can I disable Scientific notation. When it auto convert to Scientific notation, I lost accuracy. Thanks a lot! Ryan
4
by: kschneider | last post by:
Assume there's a form with it's action attribute all set to post to a URL, but without a submit control. Form submission is done via a link and I want to prevent the classic "double submit"....
19
by: RedDevilDan | last post by:
I am working on a Memory Footprint Reduction project. I came across an idea to disable all printf statements so that less memory is required. In addition, when there is no single printf statement,...
12
by: =?Utf-8?B?bV9nZWxs?= | last post by:
Hi, anyone know how to disable reflection on sensitive code? Here is specifically what I'm trying to do. I have one method in a class within an assembly I'm trying to prevent using reflection to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
0
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...

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.