LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Shortcut menu - submenus

Using Office 2007 and Win XP;

I have a shortcut menu that has a couple menus on it, so when you hover on
the menu, a sub menu appears.

Problem is, everytime I hover on a menu, then hover over another menu, then
return to hover over the first menu again, the submenu doubles in size, only
with blanks.

I have a function I call that deletes the main menu, then re-builds it on
each call, and this works fine; but apparently while the main menu is held
open and the user switches between menu items, they are not rebuilt.

Sorry, I know this probably sounds a little flakey; if unclear please post
back and I will try to explain better. I guess I need to delete all the
submenu items each time the sub menus are opened; but how?

I hate to post all my code due to the complexity and length of the menu
system, but below at least is my function that builds one of the submenus. In
this example, the first time you hover, only the three items appear, on the
second hover, there would be six, then nine, etc. until the main menu is
closed, then it starts all over again...

Private Function ShortCutMenuPayroll(argShortCutMenu As String)
Dim oBar As CommandBar
Dim iX As Integer
Set oBar = Application.CommandBars(argShortCutMenu)
With oBar
iX = iX + 1
.Controls.Add Type:=msoControlButton
.Controls(iX).Caption = "Item One"
.Controls(iX).OnAction = "Macro1"
iX = iX + 1
.Controls.Add Type:=msoControlButton
.Controls(iX).Caption = "Item Two"
.Controls(iX).OnAction = "Macro2"
iX = iX + 1
.Controls.Add Type:=msoControlButton
.Controls(iX).Caption = "Item Three"
.Controls(iX).OnAction = "Macro3"
.Controls(iX).BeginGroup = True
End With
End Function

Thanks for your assistance!
 
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
What is a shortcut menu? Jeffry Excel Discussion (Misc queries) 4 May 4th 09 04:03 PM
Submenus on Shortcut Menus ZipCurs Excel Programming 2 March 4th 08 09:12 PM
Popup Menu / Shortcut Menu Dale Fye Excel Discussion (Misc queries) 2 October 12th 07 12:57 AM
shortcut menu Javed Excel Discussion (Misc queries) 1 December 6th 04 09:28 PM


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