我想创建第二个垂直工具栏。
我尝试使用此代码,但可以看到任何结果。
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)
答案 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();