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). | | | | re: Disable Double-Click?
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" <armando@bogus.comwrote in message
news:cE9yg.27$Db4.1186@news1.epix.net... Quote:
>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).
>
| | | | re: Disable Double-Click?
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" <bouncer@localhost.notwrote in message
news:j0cyg.9035$V74.2060@trnddc08... Quote:
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" <armando@bogus.comwrote in message
news:cE9yg.27$Db4.1186@news1.epix.net... Quote:
>>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).
>>
>
>
| | | | re: Disable Double-Click?
On Thu, 27 Jul 2006 20:48:08 GMT, "Armando" <armando@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. Quote:
>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).
>
| | | | re: Disable Double-Click?
Armando wrote: Quote:
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. | | | | re: Disable Double-Click?
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. | | | | re: Disable Double-Click?
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 | | | | re: Disable Double-Click?
Lyle -
I'll have to absorb this for a bit, looks interesting.
Thanks,
Armando
"Lyle Fairfield" <lylefairfield@aim.comwrote in message
news:1154059376.957938.4490@75g2000cwc.googlegroup s.com... Quote:
Armando wrote: Quote:
>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.
>
| | | | re: Disable Double-Click?
On Sat, 29 Jul 2006 04:40:08 GMT, "Armando" <armando@bogus.comwrote:
Put a DoEvents in the event, and it should repaint each time.
-Tom. Quote:
>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
>
| | | | re: Disable Double-Click?
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. |  | Similar Microsoft Access / VBA bytes | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,387 network members.
|