I am trying to change the caption of a Statebutton on a ribbon. But it does not work. It does not give an error but it just doesn't change the text. I am using 2007.3
Private Sub UltraToolbarsManager1_ToolClick(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.ToolClickEventArgs) Handles UltraToolbarsManager1.ToolClick
e.Tool.InstanceProps.Caption = "Exam View"
I have also tried casting into that object and setting it but that also does not work.
Dim stbtn As StateButtonTool = DirectCast(e.Tool, StateButtonTool)stbtn.InstanceProps.Caption = "Custom Text Caption"
What am I doing wrong?
It is possible the tool being passed into the event args of the event is not the same tool you are looking at to check the text. If not, the text is correctly not updating, because you are setting the Caption on the InstanceProps, which only apply to one instance of a tool. If you want the caption to change for all tools with the same type and key, set the Caption on the SharedProps. If you are sure the tool instance passed into the event is the correct one you want to update the caption on (you can determine this by checking the tool's Owner), then it is probably a bug and I would recommend submitting it to the support group: http://ko.infragistics.com/gethelp