Sign in to follow this  
Followers 0
devi

How to select tab?

5 posts in this topic

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.

Share this post


Link to post
Share on other sites



ControlClick ?


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Thx,

Control command is not working.bcoz,if the tab name(Results) is visible means it returns 1.That is working, but how to hold the tab name and click the tab name.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0