Showing results 1 to 4 of 4

Thread: DynProperties("Text") of a static text

  1. #1
    Join Date
    29.02.2008
    Posts
    40

    Default DynProperties("Text") of a static text

    Hello!

    Is it possible to set the DynProperties("Text") of a static text element from VBA code?

    I use following code:

    ___

    Dim KomScr As DynPicture
    Set KomScr = thisProject.DynPictures.Item("KOMANDA")
    KomScr.Elements.Item("sig_txt").DynProperties("Text") = "TEST1"

    ___
    "sig_txt" is the name of a ststic text element on screen "KOMANDA"

    But it does not function?

    What is wrang there??

    Additionaly I am trying to find out how to open a screen from VBA (screen switch)??

    Thanks and best regards!

    Jurij.

  2. #2
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    879

    Default AW: DynProperties("Text") of a static text

    It is not possible to modify this text in the runtime.... as the name of this element already implies "Static text" element.

    What you can do is do use the element "Dynamic text" where you link a string variable (i.e. from the internal driver). Then you simply write the text via VBA to this variable.

    regards,
    herbert

  3. #3
    Join Date
    29.02.2008
    Posts
    40

    Default Re: DynProperties("Text") of a static text

    Hello!

    Thanks for the answer.

    Now I am trying to set the dynamic property "Function" of a button in VBA runtime. Is this allowed? Is there somewhere in documentation seen which propertie can be set in runtime and which not?

    I would like to do the following:

    thisProject.DynPictures.Item("KOMANDA").Elements.Item("btn_OK").DynProperties("Function") = Fname

    Fname= string containing the zenon function name

    Thanks,

    BR,
    Jurij.

  4. #4
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    879

    Default AW: DynProperties("Text") of a static text

    No, the properties of elements can not be changed in the runtime - this is only possible with functions (modify function-parameters and afterwards executing).

    When you want to execute some different actions on a button, based on a logic within VBA, do it this way:
    - link a LeftClickUp() Makro to the button
    - remove the function which is linked to this button by now
    - in the LeftClickUp() Makro you then execute the function which you want

    Regards,
    Herbert

Similar Threads

  1. RGM - VBA - ".Save" / ".Read" - change recipe status
    By markclemens in forum zenon Supervisor
    Replies: 12
    Last Post: 29th September 2014, 12:25
  2. Replies: 2
    Last Post: 21st June 2010, 08:42
  3. Replies: 3
    Last Post: 5th March 2010, 08:50
  4. Change Text Button with DynProperties
    By acko01 in forum VBA
    Replies: 2
    Last Post: 16th October 2009, 10:29
  5. Replies: 5
    Last Post: 28th November 2008, 10:49

Posting Rules

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