0

I would like to make a second vertical Toolbar.

I tried with this code but I can see any result.

Dim buttons2 As ToolBarButton() = New ToolBarButton(1) {}
Dim bmp1 As Bitmap = My.Resources.Bitmap1
buttons2(0) = New devDept.Eyeshot.ToolBarButton(bmp1, "Something", "Something", devDept.Eyeshot.ToolBarButton.styleType.PushButton, True)

Dim bmp2 As Bitmap = My.Resources.Bitmap2
buttons2(1) = New devDept.Eyeshot.ToolBarButton(bmp2, "Something more", "Something more", devDept.Eyeshot.ToolBarButton.styleType.PushButton, True)

Dim tb As ToolBar = New ToolBar(ToolBar.positionType.VerticalMiddleLeft, True, buttons2)
Franck
  • 4,438
  • 1
  • 28
  • 55
User300
  • 11
  • 2
  • How are you adding the toolbar to the `ViewportLayout` ? And have you tried adding the toolbar in the control in design mode and use visibility instead ? Personally i have many toolbars and i just created empty toolbars that i fill dynamically. – Franck Jul 24 '19 at 12:11

1 Answers1

1

If you want to add a new ToolBar in Eyeshot not in design mode:

  • create a new ToolBar as you did
  • add this new ToolBar to the Environment.OsservableCollection < ToolBar >
  • call the method Environment.CompileUserInterfaceElements()

Snippet code in C# WPF:

ToolBarButton toolBarButton = new ToolBarButton(buttonImage, "spongeBob", "spongeBob", ToolBarButton.styleType.PushButton, true);

ObservableCollection<ToolBarButton> toolBarButtons = new ObservableCollection<ToolBarButton>() { toolBarButton };

ToolBar toolBar = new ToolBar(ToolBar.positionType.VerticalMiddleLeft, true, toolBarButtons);
model1.GetToolBars().Add(toolBar);
model1.CompileUserInterfaceElements();

Multiple ToolBars picture

MatteLibro
  • 11
  • 1