Hi,
I'm trying to hide tools within a ribbon. I understand from other posts that to achieve this I have to set the Office2007UICompatibility to false.
This works perfectly however as a result of this setting, a menubar is created on screen, as well as my existing ribbon. I have tried to hide this automatically created menu bar without any success as I get an error message saying that it cannot be hidden.
Is there a workaround to this?
Thanks in advance,
Dunk
Here's an image of a dummy screen displaying the issue in case my explanation wasn't very clear.
In this example I'm trying to hide the 9 flag images programatically.
Thanks,
Hello,
I believe that this is a standard toolbar which cannot be displayed when the 'Office2007UICompatibility' is set to 'true', so it exists and is not being created by setting the above property to 'false' but is shown by the result of setting this. So you have to hide it if you want to have the Office2007UI enabled.
Please let me know if I am not clear enough.
Thanks for the quick reply, Boris.
I have tried hiding the toolbar using the below code:
oForm:ToolbarsManager:Toolbars[0]:Visible = false. < this removes the different button options correctly
oForm:ToolbarsManager:Toolbars[1]:Visible = false. < I assume this tries to remove the file/options/help but creates the following error:
"Can't change the visibility of the main menu bar"
Hello Dunk,
I do not have any knowledge of your scenario or application so I cannot tell you for sure which toolbar you need to hide. Please provide a small sample project with the scenario, I will be happy to take a look at it.
Hi Boris,
As a workaround to the issue is it possible to create the tools when the screen is initialised and then delete them programatically, with the UICompatibility enabled?
For instance create 3 tools dynamically, change something on screen, as a result - destroy the 3 tools and recreate two new ones?
Cheers,
Hello ,
As far as I understand from your conversation with Boris, you want to hide toolbar , but it seems that this toolbar is MineMenuBar and you recieve exception when you are trying to hide it. So what you could do in your case is first to make this toolbar not to be main toolbar, you could use code like:ultraToolbarsManager1.Toolbars[0].IsMainMenuBar = false;
and then to hide it with code like:ultraToolbarsManager1.Toolbars[0].Visible = false;
I have implemented this suggestion in a small sample, please run the sample and press “Hide” button.
Please let me know if you have any further questions.
Thank you for your help Hristo, it worked perfectly.
Many Thanks,