Forum Discussion

subbu_valliappa's avatar
subbu_valliappa
Contributor
10 years ago

Close DotNetBar TabStrip/TabItem

I'm testing on DevComponents.DotNetBar.TabStrip (Product Version 7.4.0.4). Moving between tabs is fine but I can't close the tab - the 'X' at the far right of the TabStrip (which does the close) is not recognised by TestComplete Object Spy. Only the tabs are child items of TabStrip - tabs are DotNetBar.TabItem.

 

I could use Click method with co-ordinates but this is not very reliable. Is there another way to do this?

  • Colin_McCrae's avatar
    Colin_McCrae
    10 years ago

    As long as location relative to parent/associated object is consistent, using an offset and co-ordinate click calculated at run time is fine. I have to use them with a customised checkbox tree list. It has some custom event handlers that only trigger with a click event in the right place (over the checkbox). Only  way to activate it is to use an offset derived from the co-ordinates of the tree node text of the node you want. But it's always calculated during the run, using retrieved co-ordinates of the text node container. Works perfectly.

     

    Hard coded co-ordinates however, are a recipie for disaster ....

  • Two possible ways I can think of:

     

    1. To use the "X" in the corner, you can probably get the dimensions of the tab strip itself and then use those with an offset value to click the "X" as it should always be in the top right corner of the strip yes?

     

    Failing that ...

     

    2. Have you looked at the available methods for the tabstrip object? It may well have a "Close" or "Quit" method or something you can call.

    • subbu_valliappa's avatar
      subbu_valliappa
      Contributor

      Yes, I thought about the offset method as the "X" would be always at the top right corner. That is probably the best option for now as I couldn't find any "Close", "Exit" or "Quit" method for the tabstrip object.

      • Colin_McCrae's avatar
        Colin_McCrae
        Community Hero

        As long as location relative to parent/associated object is consistent, using an offset and co-ordinate click calculated at run time is fine. I have to use them with a customised checkbox tree list. It has some custom event handlers that only trigger with a click event in the right place (over the checkbox). Only  way to activate it is to use an offset derived from the co-ordinates of the tree node text of the node you want. But it's always calculated during the run, using retrieved co-ordinates of the text node container. Works perfectly.

         

        Hard coded co-ordinates however, are a recipie for disaster ....