Preselect sub menu item |
Post Reply |
Author | |
rdeboer
Groupie Joined: 29 April 2004 Location: Netherlands Status: Offline Points: 81 |
Post Options
Thanks(0)
Posted: 21 December 2010 at 12:56pm |
Hi,
How do i pre select a submenu item in CommandBars? For instance i have a menu: File -> Zoom and Zoom has 3 items (zoom1, zoom2, zoom3) I want to preselect Zoom3, but not execute it yet. Something like: CommandBars.Controls(ID_ZOOM3).Selected = true |
|
Product: Xtreme Suite Pro (ActiveX) version 11
Platform: Windows XP SP3 (32bit) Language: Visual Basic 6.0 SP6 |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
I think you want Control.Checked property
|
|
rdeboer
Groupie Joined: 29 April 2004 Location: Netherlands Status: Offline Points: 81 |
Post Options
Thanks(0)
|
I'm not sure if its checked property.
I want to select PageWidth item directly from code. Something like CommandBars.Controls(ID_PAGEWIDTH).Selected = True Look at this picture as example: |
|
Product: Xtreme Suite Pro (ActiveX) version 11
Platform: Windows XP SP3 (32bit) Language: Visual Basic 6.0 SP6 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
Try this:
CommandBars.FindControl(, ID_MENU_ITEM, True, True).Execute 'Opens menu item
CommandBars.FindControl(, ID_MENU_SUBITEM, True, True).SetFocus 'Selects subitem |
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
rdeboer
Groupie Joined: 29 April 2004 Location: Netherlands Status: Offline Points: 81 |
Post Options
Thanks(0)
|
That seems to work in that sample, now im trying to get it to work in the RibbonSample, with the menu you get when you click the logo on the left top, but your code doesn't seem to work on this one :(
|
|
Product: Xtreme Suite Pro (ActiveX) version 11
Platform: Windows XP SP3 (32bit) Language: Visual Basic 6.0 SP6 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
Of course it doesn't work, you need to "open" menu first. With "normal" menu use above code and with Ribbonbar you need to "simulate" ControlSystemButton click
Dim RibbonBar As RibbonBar
Set RibbonBar = CommandBars.ActiveMenuBar RibbonBar.ControlSystemButton.Execute 'Shows menu .....
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
rdeboer
Groupie Joined: 29 April 2004 Location: Netherlands Status: Offline Points: 81 |
Post Options
Thanks(0)
|
That worked!
Thanks again for your help! Happy holidays! |
|
Product: Xtreme Suite Pro (ActiveX) version 11
Platform: Windows XP SP3 (32bit) Language: Visual Basic 6.0 SP6 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |