Oleg,
I created a test project and copied the existing code into the new project. You wouldn't believe it, but it works !!!
Now for my existing project. Loading the toolbar like this:
Private function LoodToolbarItems()
CommandBarSubviews.Icons.RemoveAll CommandBarSubviews.Icons.LoadBitmap App.Path & "\Views\AreaBackground\toolsviews.bmp", Array(301, 302, 303, 304, 305, 306, 307, 308), xtpImageNormal Set toolBarSubViews = CommandBarSubviews.Add("Tools subview", xtpBarTop) AddButton toolBarSubViews.Controls, xtpControlButton, ID_TOOLBAR_LEFT, "", True, "Moves selected item to the left", xtpButtonIcon, "ToolSubView", True
''for every button AddButton.......
End Function
Private Function AddButton(Controls As CommandBarControls, ControlType As XtremeCommandBars.XTPControlType, Id As Long, Caption As String, Optional BeginGroup As Boolean = False, Optional DescriptionText As String = "", Optional ButtonStyle As XTPButtonStyle = xtpButtonAutomatic, Optional Category As String = "Controls", Optional ButtonClose As Boolean = True) As CommandBarControl Dim Control As CommandBarControl Set Control = Controls.Add(ControlType, Id, Caption) Control.BeginGroup = BeginGroup Control.DescriptionText = DescriptionText Control.Style = ButtonStyle Control.Category = Category Control.Enabled = True Control.CloseSubMenuOnClick = ButtonClose Set AddButton = Control End Function
When everything is loaded I don't get images on the added buttons.
I added a testbutton with just 2 lines of code:
CommandBarSubviews.Icons.RemoveAll
CommandBarSubviews.Icons.LoadBitmap App.Path & "\Views\AreaBackground\toolsviews.bmp", Array(301, 302, 303, 304, 305, 306, 307, 308), xtpImageNormal
Now the icons will be shown!!!
But it's getting really weird now. I have a mainview (a form) with commandbar (Name = CommandbarView) and I use the same images for positioning (like the subviews (Name = CommandbarSubview)). When I load the images for CommandbarView (same ID's) ,the icons in CommandbarSubviews will be shown as well???
Are you following me, Oleg? Is it possible that Commandbars somehow connects with eachother? The only thing they have is a common Button.ID
I don't use Actions or anything else.
This is hairpuller of the third kind, I believe.
|