Button Caption at runtime

attardcattardc Member Posts: 97
Is there a way to change a button's caption at runtime?

I use the same form to show YES, NO, and at times i need to show just CANCEL. I'm hiding the YES button when not needed.

I can create a third button CANCEL but then there will be gaps between buttons, like

YES NO CANCEL OR CANCEL YES NO
YES NO GAP CANCEL GAP GAP

Comments

  • BBlueBBlue Member Posts: 90
    You can control the buttons position on the form programatically through XPos and YPos. So, depending on your actions on the form you can set the position for a certain control (e.g. a button):
    CurrForm.ControlName.XPOS := IntegerValue;
    CurrForm.ControlName.YPOS := IntegerValue;
    
    //Bogdan
  • attardcattardc Member Posts: 97
    Thanks a lot.. works well :)
Sign In or Register to comment.