471,579 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,579 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 7798
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Bob Bedford | last post: by
reply views Thread by John Grandy | last post: by
4 posts views Thread by Chris | last post: by
2 posts views Thread by Ryan Liu | last post: by
19 posts views Thread by RedDevilDan | last post: by
12 posts views Thread by =?Utf-8?B?bV9nZWxs?= | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by lumer26 | last post: by
1 post views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by

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.