Jump to content

How to select tab?


devi
 Share

Recommended Posts

I want to check the tab name(Results) is visible or not .so, i use this command

$exist = ControlCommand("Title", "", "[CLASS:Class Name;INSTANCE:29]", "IsVisible","Results")

then i got tab name is visible.now i want to click the tab name(Results).can u suggest which command is better.

Link to comment
Share on other sites

I want to check the tab name(Results) is visible or not .so, i use this command

$exist = ControlCommand("Title", "", "[CLASS:Class Name;INSTANCE:29]", "IsVisible","Results")

then i got tab name is visible.now i want to click the tab name(Results).can u suggest which command is better.

You sure you are using the ControlCommand() properly? Help File says nothing is required in the last parameter (where you have "Results"), so it's likely that 1 that is returned is referring to the window, not the tab.

I've never done this because I never had a need for it, but try ControlCommand with the "CurrentTab" command, to check if you're on the right tab. If not, use ControlCommand again this time with the TabLeft or TabRight command then check again to see fi you're on the right tab. Then, you don't need to click the tab because it looks like these functions navigate the tabs for you when called.

Edit/add: So looks like there's a GuiTab.au3 UDF with a function called _GUICtrlTab_ClickTab(). Try that! It might only work with GUIs created with AutoIt, though.

Edited by MrMitchell
Link to comment
Share on other sites

  • 1 year later...

Hi All,

I am using VB6 standard SSTab control(SSTabCtlWndClass). In my case non of UDF controls return expected value. I tried with controlcommand, even it's not working in my case.

Following are not working:

Method1:

    local $hWnd = WaitControlGetHandle( "SSTabCtlWndClass1")
   
    If $hWnd = "" Then
        Return -1;
    Endif

    ; Loop through all tabs to find the matching text, I think this only includes visible tabs
 For $TabIdx = 0 To _GUICtrlTab_GetItemCount($hWnd)
  local $sTabCaption = _GUICtrlTab_GetItemText($hWnd, $TabIdx)
        If $sTabCaption = "Indicators"Then                               (Indicators is my tab name)
            Return $TabIdx
        Endif
 Next

_GUICtrlTab_GetItemCount returns 0 while they are 2 tabs exists.

_GUICtrlTab_GetItemText is always returns blank.

 

Method2:

   local $Ret = ControlCommand($m_CurrentObject,"","SSTabCtlWndClass1", "CurrentTab","")
   local $Ret1 = ControlCommand($m_CurrentObject,"","SSTabCtlWndClass1", "TabRight", "")

return is 0 in both cases.

Kindly help.

Thank you,

KT

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...