Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Double Click Custom Command Bar

Using XL2003.

I have custom command bar that I've attached to an add-in with different
procedures for each button (via the OnAction property). Everything works
fine, but I would like to add some more functionality so that if a user
double clicks on a button a different stream of code will run. Since you can
only associate one procedure with a command bar button (as far as I know), I
was hoping that there was some way to determine if the user single or double
clicked the button and then I could continue accordingly. For example (psuedo
code),

Sub CustomButton()
If SingleClick then
' Perform single click code
Elseif DoubleClick then
' Perform double click code
EndIf
End Sub

Any help would be greatly appreciated. Thanks in advance.

-Cory
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Double Click Custom Command Bar

Since you can only associate one procedure with a command bar button (as
far as I know),


You're right and, come to think about it, what you're contemplating is
pretty non-standard. Can you think of any apps where double-clicking a menu
item results in a different action? OTOH some apps, like Excel, do have
different behaviors sometimes when the Shift key is held down during a
click. You might pursue that one.

Declare Function GetKeyState32 Lib "User32" Alias "GetKeyState" (ByVal vKey
As Integer) As Integer

Sub MyMenuHandler()
If ShiftDown Then
....
Else
....
End If

Function ShiftDown() As Boolean
ShiftDown = (GetKeyState32(16) < 0)
End Function

--
Jim
"Cory" wrote in message
...
| Using XL2003.
|
| I have custom command bar that I've attached to an add-in with different
| procedures for each button (via the OnAction property). Everything works
| fine, but I would like to add some more functionality so that if a user
| double clicks on a button a different stream of code will run. Since you
can
| only associate one procedure with a command bar button (as far as I know),
I
| was hoping that there was some way to determine if the user single or
double
| clicked the button and then I could continue accordingly. For example
(psuedo
| code),
|
| Sub CustomButton()
| If SingleClick then
| ' Perform single click code
| Elseif DoubleClick then
| ' Perform double click code
| EndIf
| End Sub
|
| Any help would be greatly appreciated. Thanks in advance.
|
| -Cory


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Double Click Custom Command Bar

Jim - Thanks for the help. I'm going to hold out hope on the double clicking,
but will keep the Shift idea in mind.

The only double click menu example that I can think of would be the Format
Painter in either XL or Word. A single click will paste formats for only one
click and release of the mouse button. A double click allows you to
continously click and release the mouse button until the format painter is
turned off by a single click.

-Cory

"Jim Rech" wrote:

Since you can only associate one procedure with a command bar button (as
far as I know),


You're right and, come to think about it, what you're contemplating is
pretty non-standard. Can you think of any apps where double-clicking a menu
item results in a different action? OTOH some apps, like Excel, do have
different behaviors sometimes when the Shift key is held down during a
click. You might pursue that one.

Declare Function GetKeyState32 Lib "User32" Alias "GetKeyState" (ByVal vKey
As Integer) As Integer

Sub MyMenuHandler()
If ShiftDown Then
....
Else
....
End If

Function ShiftDown() As Boolean
ShiftDown = (GetKeyState32(16) < 0)
End Function

--
Jim
"Cory" wrote in message
...
| Using XL2003.
|
| I have custom command bar that I've attached to an add-in with different
| procedures for each button (via the OnAction property). Everything works
| fine, but I would like to add some more functionality so that if a user
| double clicks on a button a different stream of code will run. Since you
can
| only associate one procedure with a command bar button (as far as I know),
I
| was hoping that there was some way to determine if the user single or
double
| clicked the button and then I could continue accordingly. For example
(psuedo
| code),
|
| Sub CustomButton()
| If SingleClick then
| ' Perform single click code
| Elseif DoubleClick then
| ' Perform double click code
| EndIf
| End Sub
|
| Any help would be greatly appreciated. Thanks in advance.
|
| -Cory



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
userform label double-click goes to click event John Paul Fullerton Excel Programming 3 May 19th 06 05:54 PM
Using double click on active cell to open a custom help window burl_rfc Excel Programming 1 February 22nd 06 09:49 PM
Cell contents with custom time format rounded after double-click HumblePie Excel Discussion (Misc queries) 2 August 6th 05 08:07 PM
Click on graph bar to execute a double-click in a pivot table cell [email protected] Charts and Charting in Excel 4 August 3rd 05 01:37 AM
Mouse Over Graph, Capture Information on Click(Double Click) Dean Hinson[_3_] Excel Programming 1 December 6th 04 04:49 AM


All times are GMT +1. The time now is 11:24 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"