如何在Eyeshot 12中制作多个工具栏?

时间:2019-07-18 07:48:47

标签: vb.net cad eyeshot

我想创建第二个垂直工具栏。

我尝试使用此代码,但可以看到任何结果。

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)

1 个答案:

答案 0 :(得分:1)

如果要在设计模式下在Eyeshot中添加新的工具栏:

  • 像您一样创建新的ToolBar
  • 将此新的ToolBar添加到Environment.OsservableCollection < ToolBar >
  • 调用方法Environment.CompileUserInterfaceElements()

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