Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default userform label double-click goes to click event

Hi

I have a VBA form that I'm using in Excel 2002. On one label in the form, I
want to run one function from the click event and another from the
double-click event. However, when I double-click the label, I always get the
click event. I've checked the double-click speed from control panel and it
seems to be ok. The form is *not* being shown modal.

Have a nice day
John Paul Fullerton

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default userform label double-click goes to click event

That seems to be by design: (from help on dblClick)

For this event to occur, the two clicks must occur within the time span
specified by the system's double-click speed setting.
For controls that support Click, the following sequence of events leads to
the DblClick event:

1. MouseDown
2. MouseUp
3. Click
4. DblClick

If a control, such as TextBox, does not support Click, Click is omitted fom
the order of events leading to the DblClick event.

Perhaps use Right Click for the second action.

--
Regards,
Tom Ogilvy



"John Paul Fullerton" <John Paul wrote
in message ...
Hi

I have a VBA form that I'm using in Excel 2002. On one label in the form,

I
want to run one function from the click event and another from the
double-click event. However, when I double-click the label, I always get

the
click event. I've checked the double-click speed from control panel and it
seems to be ok. The form is *not* being shown modal.

Have a nice day
John Paul Fullerton



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default userform label double-click goes to click event

Thank you for the note.

Could you let me know more about this?

When I go to the form design screen, I can select dblclick for the label and
I put code in that event (and other code in the click event). Eventually I
just put msgbox's in both to let me know what event I was accessing. When I
double-click the label when the macro is running and the form is displayed,
it shows me the msgbox for the click event. I can consistently activate
double-click in the control panel program, however not in macro. I can get
access to the form's double-click event from double-clicking the form.

Have a nice day
John Paul Fullerton



"Tom Ogilvy" wrote:

That seems to be by design: (from help on dblClick)

For this event to occur, the two clicks must occur within the time span
specified by the system's double-click speed setting.
For controls that support Click, the following sequence of events leads to
the DblClick event:

1. MouseDown
2. MouseUp
3. Click
4. DblClick

If a control, such as TextBox, does not support Click, Click is omitted fom
the order of events leading to the DblClick event.

Perhaps use Right Click for the second action.

--
Regards,
Tom Ogilvy



"John Paul Fullerton" <John Paul wrote
in message ...
Hi

I have a VBA form that I'm using in Excel 2002. On one label in the form,

I
want to run one function from the click event and another from the
double-click event. However, when I double-click the label, I always get

the
click event. I've checked the double-click speed from control panel and it
seems to be ok. The form is *not* being shown modal.

Have a nice day
John Paul Fullerton




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default userform label double-click goes to click event

I found some code online that allows click and double click

Dim isClick As Boolean

Private Sub Label1_Click()
Dim t As Single
isClick = True
' Wait for the second click for half a second.
t = Timer
Do
DoEvents
' If the DblClick procedure canceled this event,
' bail out.
If Not isClick Then Exit Sub
' The next test accounts for clicks just before midnight.
Loop Until Timer t + 0.5 Or Timer < t
' Do your single-click processing here.
MsgBox "click"
End Sub

Private Sub Label1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
' Cancel any pending click.
isClick = False
' Do your double-click processing here.
MsgBox "double-click"
End Sub

Have a nice day
John Paul Fullerton



"Tom Ogilvy" wrote:

That seems to be by design: (from help on dblClick)

For this event to occur, the two clicks must occur within the time span
specified by the system's double-click speed setting.
For controls that support Click, the following sequence of events leads to
the DblClick event:

1. MouseDown
2. MouseUp
3. Click
4. DblClick

If a control, such as TextBox, does not support Click, Click is omitted fom
the order of events leading to the DblClick event.

Perhaps use Right Click for the second action.

--
Regards,
Tom Ogilvy



"John Paul Fullerton" <John Paul wrote
in message ...
Hi

I have a VBA form that I'm using in Excel 2002. On one label in the form,

I
want to run one function from the click event and another from the
double-click event. However, when I double-click the label, I always get

the
click event. I've checked the double-click speed from control panel and it
seems to be ok. The form is *not* being shown modal.

Have a nice day
John Paul Fullerton




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a double click event for cell? Ayo Excel Discussion (Misc queries) 3 June 6th 08 12:18 AM
Double-click Event question Bob Wall Excel Programming 2 September 6th 04 03:21 AM
Sheet After Double Click event? Tom Ogilvy Excel Programming 0 July 27th 04 05:59 PM
Key modifier for double-click event? Byrt Martinez[_3_] Excel Programming 1 February 20th 04 08:00 PM
Before Double Click Event gregork Excel Programming 4 February 9th 04 09:17 AM


All times are GMT +1. The time now is 03:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"