Print Page | Close Window

Load Dinamically CommandBars

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=22955
Printed Date: 21 November 2024 at 9:19pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Load Dinamically CommandBars
Posted By: aldog@imaginesoft.co
Subject: Load Dinamically CommandBars
Date Posted: 09 March 2016 at 12:45pm
Hi everyone,


I'm trying to dynamically load the CommandBars control. For this I used the same example that comes with version 17, I removed the controls at design time, and then instantiate at runtime with:

Set CommandBars = Me.Controls.Add("Codejock.CommandBars.17.1.0", "CommandBars")

The problem is that dynamically loading background images are not loaded

What am I doing wrong?



Replies:
Posted By: olebed
Date Posted: 10 March 2016 at 3:20am
Hello aldog,

I suppose you forgot to load  VisualStudio2015.dll before setting theme VisualStudio2015 (or other DLL for other theme)

  CommandBarsGlobalSettings.ResourceImages.LoadFromFile App.Path & "\..\..\..\Styles\VisualStudio2015.dll", "VisualStudio2015Blue.ini"
  CommandBars.VisualTheme = xtpThemeVisualStudio2015


You can explore our sample
c:\Program Files (x86)\Codejock Software\ActiveX\Xtreme SuitePro ActiveX v17.1.0\Samples\CommandBars\VB\RibbonSample
to see how set different themes in v17.1.

In file frmMain.frm look for methods CreateRibbonBar, SetStyle, SetCommandbarsTheme and other.

Regards,
  Oleksandr Lebed


Posted By: aldog@imaginesoft.co
Date Posted: 10 March 2016 at 2:46pm
Hi olebed, thanks for answering Smile
I did what you say but still the same:



Posted By: aldog@imaginesoft.co
Date Posted: 10 March 2016 at 3:04pm
I've gotten it to work, but the object does not assume the skin

 Set CommandBars = Me.Controls.Add("Codejock.CommandBars.17.1.0", "CommandBars")

            
    LoadIcons
    CreateActions
    CreateRibbonBar
    
    FontSizes(0) = 0
    FontSizes(1) = 11
    FontSizes(2) = 13
    FontSizes(3) = 16
    
    
CommandBarsGlobalSettings.ResourceImages.LoadFromFile "C:\Program Files (x86)\Codejock Software\ActiveX\Xtreme SuitePro ActiveX v17.1.0 (30 Day Trial)" & _
                                                    "\Samples\Styles\VisualStudio2015.dll", "VisualStudio2015Blue.ini"
CommandBars.VisualTheme = xtpThemeVisualStudio2015


SetCommandbarsTheme xtpThemeOffice2013, App.Path & "\..\..\..\Styles\VisualStudio2015.dll", "VisualStudio2015.ini"
ControlFile.Style = xtpButtonCaption

'CreateBackstageView
CommandBars.PaintManager.RefreshMetrics
CommandBars.RecalcLayout



Dynamically load:



Design time load



Posted By: olebed
Date Posted: 10 March 2016 at 4:11pm
SetCommandbarsTheme xtpThemeOffice2013, App.Path & "\..\..\..\Styles\VisualStudio2015.dll", "VisualStudio2015.ini"
SetCommandbarsTheme xtpThemeVisualStudio2015, App.Path & "\..\..\..\Styles\VisualStudio2015.dll", "VisualStudio2015.ini"


Also skins and themes are different technologies which have problems with compatibility.

Screenshot under "Dynamically load:"  - looks like Dark Gray Office2013 theme from file Office2013WordDarkGray.ini



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net