I changed this topic because I sorted the code out myself.
As the topic says, how can I change the caption of the button once it has been pressed.
Thanks
How Can I change the Caption on a button after it is clicked
Moderators: JRL, Dorian (MJT support)
I wasn't sure if you still wanted this or not but for the sake of posterity here is an answer.
Code: Select all
Dialog>Dialog1
object Dialog1: TForm
Left = 299
Top = 212
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'CustomDialog'
ClientHeight = 223
ClientWidth = 439
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 96
TextHeight = 13
object MSButton1: tMSButton
Left = 80
Top = 37
Width = 265
Height = 124
Caption = 'Please Press Button 1'
DoubleBuffered = True
ParentDoubleBuffered = False
TabOrder = 8
DoBrowse = False
BrowseStyle = fbOpen
end
end
EndDialog>Dialog1
//The Dialog handler tells the script to go to a specified
//subroutine when an event occurs. In this case it is the
//click of button 1.
AddDialogHandler>Dialog1,msButton1,OnClick,Button1WasPressed
Show>dialog1,res1
SRT>Button1WasPressed
//SetDialogProperties is used to dynamically change the properties
//of dialog objects. In this case we're changing the value of the
//"Caption" property of Button 1.
SetDialogProperty>Dialog1,msButton1,Caption,Button 1 Was Pressed
Wait>3
Exit>0
END>Button1WasPressed
Thanks for posting this example JRL.
Take care
Take care
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
