Showing results 1 to 4 of 4

Thread: Change the text on a button in the runtime

  1. #1
    Join Date
    06.02.2013
    Posts
    14

    Default Change the text on a button in the runtime

    Hi everybody,

    ís there no way to change the "Text1" from a button? (during the runtime runs)

    I have a button which triggers a macro. when i press the button the first time,
    i want to edit the Text1
    (start Event -> stop Event)

    when i press the button the second time
    i want to edit the Text1
    (stop Event -> start Event)


    Other Options:

    create 2 Buttons at the same Location
    create 1 bool Variable named Eventstarted

    Button1.Text1 = stop Event
    visible from 1-1 (depends on the Variable Eventstarted)


    Button2.Text1 = startEvent
    visible from 0-0 (depends on the Variable Eventstarted)

    is there a better/easier way to manage the problem?

    Regards,
    Sven

  2. #2
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    879

    Default Re: Problems with set_DynProperties

    no coding required for this:

    - take a button
    - link a bool-variable to it
    - configure the button as switch
    - at the button properties at "Representation" -> "Text line 1" you write "Start"
    - at the button properties at "Representation" -> "Text when pressed" you write "Stop"

    regards,
    herbert


  3. #3
    Join Date
    06.02.2013
    Posts
    14

    Default Re: Problems with set_DynProperties

    Hi herbert,

    i tried it, but the button will only show "Stop", when the mousebutton is pressed. when i take my "finger away" from the mousebutton the button shows start, but that´s not what i want to have

    the button should show "start" until i press it.

    when i pressed it, the text should change to "stop", till i pressed it again
    (than it should show "start")

    regards,
    Sven

  4. #4
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    879

    Default Re: Problems with set_DynProperties

    check out the properties of the button
    -> from your description probably the checkbox "Momentary switch" is enabled
    -> if so, please deactivate

    regards,
    herbert


Similar Threads

  1. Replies: 5
    Last Post: 18th July 2014, 13:06
  2. press button - change color
    By rgv0021 in forum VBA
    Replies: 2
    Last Post: 28th October 2013, 08:05
  3. Replies: 1
    Last Post: 7th June 2013, 16:14
  4. how to change text and color of invisible button
    By tanveerali in forum zenon Supervisor
    Replies: 1
    Last Post: 14th February 2011, 00:09
  5. Change Text Button with DynProperties
    By acko01 in forum VBA
    Replies: 2
    Last Post: 16th October 2009, 10:29

Posting Rules

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