Print Page | Close Window

How to use BeginGroup in nested menus?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=12555
Printed Date: 07 October 2024 at 10:30am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to use BeginGroup in nested menus?
Posted By: eugene_v
Subject: How to use BeginGroup in nested menus?
Date 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



Replies:
Posted By: Oleg
Date 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


Posted By: eugene_v
Date 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


Posted By: Oleg
Date Posted: 30 October 2008 at 3:11am
How you declared ControlAscending  ?

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net