Showing results 1 to 3 of 3

Thread: Change Text Button with DynProperties

  1. #1
    acko01 Gast

    Default Change Text Button with DynProperties

    Hello

    I am trying to change the Text of a Text Button in VBA with Dynproperties. Unfortunatly without success..
    This is my line of code:
    thisProject.DynPictures.Item("SPÜLEN").Elements.Item("SpülenStarten").DynProperties("Text1") = "Stop"

    I need to change the Text of the Button from "Start" to "Stop" during runtime. Is there another way to do this? I can't imagine that I am the first one trying to do so .

    Greetings
    Dermot

  2. #2

    Default Re: Change Text Button with DynProperties

    some dynproperties of elements can be changed during runtime, but in the case of a button if the text is changed this change is not saved into the compiled picture and when the picture is opened again, the original text from the compiled picture is shown.

    Changing the text of a button through dynproperties for a button in this case, is editor VBA functionality only. (wizards, automatic project creation through VBA)

    There are many ways of displaying a different text or graphic for a button during runtime, without using VBA.

    you could create two buttons and depending on a variable (internal or from the PLC) make one button invisible, with the button being made invisible through dynamics being on top of the other button.

    Another way would be to use a combi-element and a symbol.

    Another way would be to place a link-text element in the picture, with an inivisble button on top of this.

    If the button directly represents a variable in the PLC, you could also set this button to be a switch and link the variable. Now define the text for normal e.g. "start" and the text for pressed "stop".

    There are even more ways, if one of the above does not fit your needs.

  3. #3
    acko01 Gast

    Default Re: Change Text Button with DynProperties

    Thank you for the reply.

    I chose the two button version. It works for me.

Similar Threads

  1. Change the Ip Address in Zenon 5.5
    By sikenga in forum zenon Network
    Replies: 1
    Last Post: 9th June 2009, 13:09
  2. Replies: 1
    Last Post: 2nd December 2008, 11:07
  3. Replies: 14
    Last Post: 1st December 2008, 09:46
  4. Change variable status
    By brada in forum VBA
    Replies: 5
    Last Post: 13th February 2008, 17:55
  5. Value changes are protocolled in CEL, although there is no change
    By markusw in forum Engineering Studio & Service Engine (former zenon Editor & Runtime)
    Replies: 0
    Last Post: 21st August 2007, 08:15

Posting Rules

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