Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - How to use BeginGroup in nested menus?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to use BeginGroup in nested menus?

 Post Reply Post Reply
Author
Message
eugene_v View Drop Down
Groupie
Groupie
Avatar

Joined: 12 September 2007
Location: Canada
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote eugene_v Quote  Post ReplyReply Direct Link To This Post Topic: How to use BeginGroup in nested menus?
    Posted: 28 October 2008 at 8:18pm
Good day everyone!
 
Could someone point me at how to use BeginGroup in nested menus?
 
Here is my code:
 

  'Creating View menu and items
  Set ControlView = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, ID_VIEW, "&View")
  With ControlView.CommandBar.Controls
    .Add xtpControlButton, ID_VIEW_CustomerList, "Customer &List..."
    .Add xtpControlButton, ID_VIEW_Inventory, "&Inventory..."
    '---
    Set Control = .Add(xtpControlButton, ID_VIEW_Reports, "&Reports...")
    Control.BeginGroup = True
    '---
    Set Control = .Add(xtpControlPopup, ID_VIEW_SORT, "&Sort Invoices By")
    Control.BeginGroup = True
      Control.CommandBar.Controls.Add xtpControlButton, ID_VIEW_SORT_BY_AMOUNT_DUE, "&Amount Due"
      Control.CommandBar.Controls.Add xtpControlButton, ID_VIEW_SORT_BY_STATUS, "St&atus"
      'I want to place a separator here
      Control.CommandBar.Controls.Add xtpControlButton, ID_VIEW_SORT_BY_ASCENDING, "Ascending"
      Control.BeginGroup = True 'does not work - no separator is displayed
      Control.CommandBar.Controls.Add xtpControlButton, ID_VIEW_SORT_BY_DESCENDING, "Descending"
  End With
 
Thank you very much in advance,
Eugene
Eugene V
A happy registered user of Xtreme SuitePro 2007 11.2.0 with VB6
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 29 October 2008 at 5:11am
Hi,
add additional variable
 
Set ControAscending = Control.CommandBar.Controls.Add (xtpControlButton, ID_VIEW_SORT_BY_ASCENDING, "Ascending")

ControAscending.BeginGroup = True
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
eugene_v View Drop Down
Groupie
Groupie
Avatar

Joined: 12 September 2007
Location: Canada
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote eugene_v Quote  Post ReplyReply Direct Link To This Post Posted: 29 October 2008 at 11:12pm
Oleg, thank you for the suggestion. Yet, for some reason, I get Run-time error 13, Type Mismatch on this line:
 

      Set ControlAscending = Control.CommandBar.Controls.Add(xtpControlButton, ID_VIEW_SORT_BY_ASCENDING, "Ascending")
 
For some reason it doesn't like the result returned by .Add
 
Any ideas? What am I doing wrong?
 
Eugene
Eugene V
A happy registered user of Xtreme SuitePro 2007 11.2.0 with VB6
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 30 October 2008 at 3:11am
How you declared ControlAscending  ?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.