.
Is it possible to change the name of a non-modal dialog button while the dialog is showing on the screen? For example, you could start your script with
let>k=red
And then in your dialog creation you could set the button to
Button=k,10,10,50,40,5
The word 'red' will now appear on the button. Now you can use the ShowDialog command to show the dialog on your screen. Then you can change the value of k to 'blue' later in your script. But at this point is there some way of updating the dialog without closing it? Remember, the dialog is already showing on my screen at this point, and the button says 'red'. I want to change it to 'blue' without closing the dialog. Is this possible?
Thank you,
Kwhiz
How to change the name of a Button in a dialog?
Moderators: Dorian (MJT support), JRL
Hi,
Yes. Refer to the button caption with DialogName.msButton0 where 0 is the zero based index of the button. Run this script and you will see after 2 seconds the name of the button change from red to blue:
Dialog>Dialog1
Caption=Dialog1
Width=445
Height=250
Top=188
Left=181
Button=Red,24,56,75,25,0
Button=OK,24,96,75,25,0
EndDialog>Dialog1
Show>Dialog1
Wait>2
Let>Dialog1.msbutton0=Blue
ResetDialogAction>Dialog1
Wait>5
If you step through with the debugger and the watch list open you can see the button caption variables in the watch list (Dialog1.msButton0).
Yes. Refer to the button caption with DialogName.msButton0 where 0 is the zero based index of the button. Run this script and you will see after 2 seconds the name of the button change from red to blue:
Dialog>Dialog1
Caption=Dialog1
Width=445
Height=250
Top=188
Left=181
Button=Red,24,56,75,25,0
Button=OK,24,96,75,25,0
EndDialog>Dialog1
Show>Dialog1
Wait>2
Let>Dialog1.msbutton0=Blue
ResetDialogAction>Dialog1
Wait>5
If you step through with the debugger and the watch list open you can see the button caption variables in the watch list (Dialog1.msButton0).
MJT Net Support
[email protected]
[email protected]