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
295
How to use methods GetItem, GetItemsCount, GetContent, GetItemProperty for swfToolbar
posted

Hi,

TestAdvantage ver 2010.3,

Following code is not working

'Get the list of items in the toolbar
    tlbContent = SwfWindow("Microsoft TaskVision 1.1").SwfToolBar("tbrTop").GetContent

'no. of Items in toolbar

cItems = SwfWindow("Form1").SwfToolBar("Formatting").GetItemsCount
SwfWindow("Form1").SwfToolBar("Formatting").GetItem(index)

Also not able to find out one of the toolbar button ENABLED or DISABLED property value with GetItemProperty.

As Button click Record-Playback code gives this for Toolbar

PerformToolAction tbmgrToolbar, tbmgrClick,tblbarname , btnName

There should be equivalent code for operations - GetItem(), GetItemsCount, GetContent, GetItemProperty

Pl advice on this.

Thanks,

~Laxmikant.


 

Parents
No Data
Reply
  • 9298
    posted

    Laxmikant,

    Here is an example of script that you can use with the methods that you mentioned.  You can run this script against the WinToolbarsBasicFeatures sample found in the samples that are installed with TestAdvantage.

    'Example of GetItem method
    Dim openItem
    openItem = SwfWindow("Infragistics UltraWinToolbars").SwfToolbar("_Form1_Toolbars_Dock_Area_Top").GetItem("Editors", 1)
    MSGBOX("GetItem:  " & openItem)

    'Example of GetItemsCount method
    Dim editorItemsCount
    editorItemsCount = SwfWindow("Infragistics UltraWinToolbars").SwfToolbar("_Form1_Toolbars_Dock_Area_Top").GetItemsCount("Editors")
    MSGBOX("GetItemsCount:  " & editorItemsCount)

    'Example of GetContent method
    Dim editorContent
    editorContent = SwfWindow("Infragistics UltraWinToolbars").SwfToolbar("_Form1_Toolbars_Dock_Area_Top").GetContent("Editors")
    MSGBOX("GetContent:  " & vbCrLf & editorContent)

    'Example of GetItemProperty
    Dim editorItemProperty
    editorItemProperty = SwfWindow("Infragistics UltraWinToolbars").SwfToolbar("_Form1_Toolbars_Dock_Area_Top").GetItemProperty("Editors", 1, "Enabled")
    MSGBOX("GetItemProperty:  "  & editorItemProperty)

     

    I hope you find this helpful.  Let me know if you have further questions.

    Michael S.

Children