Alpha Video Training
Results 1 to 4 of 4

Thread: ? Changing the label of a button

  1. #1
    Member
    Real Name
    Marty Francom
    Join Date
    Jan 2011
    Posts
    43

    Default ? Changing the label of a button

    How do I programmatically change the label of a button control?
    I have a button the turns on or off the ability of the user to make changes to the fields on the form. I would like the label text on the button to change from "Edit-On" to "Edit-Off"
    This is the code I am using in the OnPush event of the button, but it is not working. What might I be doing wrong?

    Code:
    if vcEditOn = "on" then 
       Button12.label = "Edit-Off"
       rc = fldEditsOFF()
       vcEditOn = "off"
    else
       Button12.label = "Edit On"
       rc = fldEditsON()
       vcEditOn = "on"
    end if

  2. #2
    "Certified" Alphaholic
    Real Name
    Tom Baker
    Join Date
    Jun 2006
    Location
    Near Cherry Hill, NJ
    Posts
    1,296

    Default Re: ? Changing the label of a button

    Marty

    try this

    Code:
    if vcEditOn = "on" then 
       parentform:Button12.text = "Edit-Off"
       rc = fldEditsOFF()
       vcEditOn = "off"
    else
       parentform:Button12.text = "Edit On"
       rc = fldEditsON()
       vcEditOn = "on"
    end if
    Are fldEditsOFF() and fldEditsON() user defined functions?

    Tom
    Last edited by Tbaker; 02-13-2011 at 09:26 PM. Reason: added something

  3. #3
    Member
    Real Name
    Marty Francom
    Join Date
    Jan 2011
    Posts
    43

    Default Re: ? Changing the label of a button

    Tom,
    Thanks again. Yes, that worked.
    and Yes, fldEditON and fldEditOFF are user defined functions.

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: ? Changing the label of a button

    See this explanation in the wiki about how to use the Object Explorer. Beats guessing what the object properties might be.
    There can be only one.

Similar Threads

  1. Button Label Changed?
    By Charles Hoens in forum Alpha Five Version 10 - Desktop Applications
    Replies: 2
    Last Post: 01-17-2010, 05:17 PM
  2. Changing a label (calculated field) during runtime?
    By jjfcpa in forum Alpha Five Version 9 - Desktop Applications
    Replies: 2
    Last Post: 07-16-2008, 10:35 AM
  3. Changing Tab Label on Tabbed GridLinker?
    By rhofrichter in forum Alpha Five Version 8
    Replies: 1
    Last Post: 08-02-2007, 05:33 PM
  4. Use a variable as button label on form
    By Jerry Gray in forum Alpha Five Version 6
    Replies: 2
    Last Post: 10-19-2004, 12:21 AM
  5. Button Genie to Print A Label
    By bhphoto47 in forum Alpha Five Version 5
    Replies: 8
    Last Post: 01-17-2004, 12:39 PM

Bookmarks

Posting Permissions

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