Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
55
Determine if dynamic tools exists and is enabled on UltraWinToolbars (SwfToolBar)
posted

Control: Infragistics2.Win.UltraWinToolbars (SwfToolBar)
Version: TestAdvantage 7.1.20071.40
QTP 9.2 with .NET and WEB add-in

Problem:
Our .NET Windows Forms application has a toolbar that has over 80 tools listed in ToolBarsManager.Tools[].  The tools are added dynamically, based on active screen criteria to ToolBarsManager.Ribbon.ApplicationMenu.ToolAreaLeft.Tools[].  Prior to attempting to select a Tool, I want to verify that the Tool exists and is enabled.  Based on the available methods for SwfTools, the only method that has been successful is GetNAProperty, which allows qualifying the dynamic Tools and Properties as shown above.  This looks something like: strToolName = .SwfToolbar("_Toolbars_Dock_Area_Top").GetNAProperty ("Ribbon.ApplicationMenu.ToolAreaLeft.Tools[1]").  I can determine the number of Tools by using the same method at a higher level and splitting the returning string.  This would allow looping through the Tool names, except for one problem.  The index part of the parameter for GetNAProperty expects a literal, so a variable will not work.  I have tried some of the other methods, such as GetContent, IsItemEnabled and ItemExists, but these return errors.  I will appreciate any suggestions.

Thank you.

Parents
No Data
Reply
  • 55
    posted

    Found a solution:  Since the index cannot be treated as a variable, I created the entire literal value and placed it in a variable.  This works!  Now the example looks like:  strToolString = "Ribbon.ApplicationMenu.ToolAreaLeft.Tools[" &LoopValue &"]"  Then, the statement becomes strToolName = .SwfToolbar("_Toolbars_Dock_Area_Top").GetNAProperty (strToolString). 

Children
No Data