Hi Infragistics,
I am struggling with the QAT, where I am trying to show a ButtonTool, with both image and text. Nomatter what I do, I can only see the image. How do I show a text as well?
Br
Thomas
aphelie said:But when you set the Office2007UICompatibility property to FALSE, you should be able to display the text. This is not the case and, as you cannot Add a labeltool to the QAT, there is no way to display text... Any workaround ?
Setting Office2007UICompatibility to False does not mean you are allowed to do everything that wasn't allowed when it was True. Some behavior is constant regardless of this setting. This is one of those behaviors. The point of not allowing text in the QAT (except for editor tools) is so they take up less space. Otherwise, the tools would be placed in the overflow area after 5 or 6 tools were added. After that, the user loses the time savings of adding tools to the QAT. However, if only a few tools are going to be added, it might make sense to see the text of these tools. You can submit a feature request for the ability to show text in the QAT when Office2007UICompatibility is False and some other property is set: http://devcenter.infragistics.com/Protected/RequestFeature.aspx.
Hi Aphelie,
I have digged a little in my solution to this.
What I did, was to create my own control, containing a UltraToolbarsManager, with exactly one button, that shows both image and text. You need to put in some code to handle correct size according to image and text. I guess you can also make your own implentation, drawing image or text, etc., but I did not try that.
It was a little bit ticky to get the QAT to handle my control as I wanted. First, create the buttons you need programatically. Create a ControlContainerTool for each button, set the Control property to the buttons, and set CanSetWidth to true (important regarding sizing). Add these ControlContainerTools to the UltraToolbarsManager that contains your QAT (UltraToolbarsManager.Tools.Add(ControlContainerTool)). Also add handles to your buttons (click events, etc.)
After this, you can add your ControlContainerTools to the ribbon (UltraToolbarsManager.Ribbon.QuickAccessToolbar.Tools.AddTool(ControlContainerTool.Key)). However, just before you add the ControlContainerTools to the ribbon, set the ControlContainerTool.SharedProps.AllowMultipleInstances = True. If you do not do this, the UltraToolbarsManager will throw you an exception.
I had some problems with changing texts to already added buttons, as the QAT did not show the buttons correct after changing texts. The trick was to first remove the ControlContainerTool from the ribbon, change the text, and hereafter add it again. Again, before add again, remeber set the ControlContainerTool.SharedProps.AllowMultipleInstances = True.
I hope this will help you gathering what you want. As you can imagine, I had some long nights making this work :)
BrThomas
The QAT does not allow showing text unless the tool is a LabelTool. This must be enforced according to the Office 2007 UI Guidelines.