Showing results 1 to 5 of 5

Thread: How to get Text Property of Static Text in Screen?

  1. #1
    Join Date
    21.07.2014
    Posts
    3

    Frage How to get Text Property of Static Text in Screen?

    hi,

    Acconding to Title, I want to know, how to get Text Property of Staric Text.

    zenOn.IDynPicture scr = this.DynPictures().Item("Screen");
    zenOn.IElement Text = scr.Elements().Item("txt"); //txt is Static Text Element name

    Messagebox.show(Text.????);

    I don't know which properties can show me the text in Static Text Element.

  2. #2
    Join Date
    09.03.2011
    Posts
    44

    Default Re: How to get Text Property of Static Text in Screen?

    Hi hyunso,

    You can find the name of the property in the "Property help" in the Editor. For that, you just need to click on the property. See attached screenshot.

    Click image for larger version

Name:	Text_DynProp.jpg
Views:	19
Size:	198.8 KB
ID:	1974

    This property is accessible in the Editor using this code (which follows the name of your elements):

    zenOn.IDynPicture scr = this.ActiveDocument.DynPictures().Item("Screen");

    zenOn.IElement Text = scr.Elements().Item("txt");

    string textProp = (Text.get_DynProperties("Text")).ToString();

    this.Application.DebugPrint("Text property of the txt element: " + textProp, zenOn.tpDebugPrintStyle.tpMsg);

    The text of the Static Text element will be displayed in the Output Window:

    Click image for larger version

Name:	Text_Outuput.jpg
Views:	18
Size:	185.3 KB
ID:	1975


    Best regards,
    Steffi

  3. #3
    Join Date
    21.07.2014
    Posts
    3

    Default Re: How to get Text Property of Static Text in Screen?

    thank you for your reply.

    actually, The concept I want is to bring data(Static Text's Text Property) in runtime.
    but It does not seem to work at runtime.

    button Click -> run Macro_test()(Get Static Text's Text) -> show Messagebox (static Text's Text)

    please,see attached capture screen.

    Click image for larger version

Name:	CaptureScreen.PNG
Views:	14
Size:	259.8 KB
ID:	1976

    actually, when all process is done, I wil see a text box's text("text sample").
    but it is not work.

  4. #4
    Join Date
    09.03.2011
    Posts
    44

    Default Re: How to get Text Property of Static Text in Screen?

    Hi hyunso,

    This property is not accessible in RT, unfortunately. All you will get is an empty message box.

    Not all the dyn properties are available in the RT.


    Best regards,
    Steffi

  5. #5
    Join Date
    21.07.2014
    Posts
    3

    Default Re: How to get Text Property of Static Text in Screen?

    Thank you

    I'll find another way.

Similar Threads

  1. Text padding in screen elements feature request
    By stolyarov_as in forum zenon Service Engine Supervisor
    Replies: 6
    Last Post: 25th October 2018, 09:57
  2. Dynamic limit text in Dynamic Text element
    By sdolnyy in forum zenon Service Engine Supervisor
    Replies: 2
    Last Post: 22nd July 2016, 12:57
  3. Freeze Notepad (text screen) in Runtime
    By dario in forum zenon Service Engine Supervisor
    Replies: 5
    Last Post: 22nd May 2013, 08:17
  4. DynProperties("Text") of a static text
    By jurijcadez in forum VBA
    Replies: 3
    Last Post: 12th June 2012, 14:09
  5. Combi element mit static Text und flashing limit background
    By jusufs in forum zenon Service Engine Supervisor
    Replies: 2
    Last Post: 21st June 2010, 08:42

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •