Forum Discussion

CBleunven's avatar
CBleunven
Contributor
12 years ago

get the text from a VCL TStatusBar

Hi to all,



In our application there is a TStatusBar (more exactly, the used class inherits from TSatusBar) from which I would like to read the text.

Ive get some information from this thread  as well as from this note but I can't access to a particular TStatutPanel.



The Panels property of my TSatusBar returns me an object which is a TStatusPanels, but there are no property or method I may used on it.  (the only property I get are the ClassName, the InstancePtr and the VCLClass), despite I've activated the "show hidden" option.



May be an important information is that I use script in C#Script. Is this may be a limitation to access Delphi properties ?



Thank you for your help,



Christophe

5 Replies

  • Hi Tanya,

    thank you for your answer.

    Unfortunately, I'm already in the Advanced view mode. The only Properties I see are  ClassName, InstancePtr and VCLClass. No methods are visible.



    Thank you for your help,

    Christophe



    PS: update to 9.10.1894.7 didn't change the result.
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Christophe,


     


    Was the app compiled with debug info? I'm offering you to contact our Support Team and send them a sample application containing the TStatusBar control - they will try to find a way to test it with TestComplete.


     

    • sl's avatar
      sl
      New Contributor

      Maybe it will help someone searching for the solution like I was.

       

      Accessing the text of e.g. the third Panel of a TStatusBar is NOT like you would expect:

       

      Aliases.MyApp.MyForm.StatusBar1.Panels[2].Text

      But instead:

      Aliases.MyApp.MyForm.StatusBar1.wText[2]

      as it can be seen for example in the code example of the documentation for WaitProperty.

       

      Or alternatively:

      Aliases.MyApp.MyForm.StatusBar1.Panels.Items[2].Text
  • m_essaid's avatar
    m_essaid
    Valued Contributor

    Hi Christophe,

    I'm not sure to understand, you are trying to get properties of a TStatusBar object but you are spying the TPanel object that contains it ? It can't work...

    Could you open you application, display the object you want (the statusBar). Then go to the Object Browser at the very left of TestComplete and browse you application object's hierarchy to find your statusBar ?

    I used to test delphi app for quite a long time. I test release versions, so I never use the debug infos. Sometimes I have to use MSAA features to spy the object, maybe you should add the TStatusBar object type in MSAA list ?