thomas.schmid

How to change the MenuBar in DxDesigner with Automation

Discussion created by thomas.schmid on Nov 20, 2012
Latest reply on Mar 10, 2016 by mjohnson

I try to change the menu to our company-requirements, some commands should be removed and some commands (e.g. own automation skripts) should be added.

My Problem is that at the first Level of the Menu (Type CommandBarSvr.CommandBarControl) there is no .count or .item

so that i can't get deeper into the Menu-hierarchy to delete or add a control.

 

Here is my sample code from vb.net:

 

Dim _dx As CVdApp = Nothing

Dim menu As CommandBarSvr.CommandBar


_dx = CType(GetObject(, "ViewDraw.Application"), CVdApp)

menu = _dx.CommandBars().Item("Sheet Menu Bar")


Dim CommandBar As CommandBarSvr.CommandBarControls = menu.Controls

Dim MainMenu As CommandBarSvr.CommandBarControl

 

For i As Integer = 1 To CommandBar.Count Step 1

     MainMenu = CommandBar.Item(i)

     Debug.Print(MainMenu.Caption)

Next

 

 

I hope someone could tell me more about the DxDesigner Menu-Automation, in Expedition it works fine with Automation.

 

Thanks

Thomas Schmid

Outcomes