Dynamically change button label?
I'm trying to implement a workaround for the fact that workflows do not support multiple languages (localization) and it's working fine except for trying to change the label on the button (ie. dynamically change it from 'Search' to 'Recherche' if the users locale is fr-CA). The rest of the labels I can switch easily from english to french using a set of Assign activities in the form's RutimeModifications. The documentation for the Display Form activity shows examples of how to access the actual form elements such as textboxes but not how to access the form buttons (which seem to be not really part of the form). For example, I use Assign's like : form.Find(Of TextBoxFormItem)(Textbox1").Label = langageDictionary("address") to pick the correct label for the address textbox for a geocoding workflow.
Does any one have an example of how to change the label of a button or at least how to access the default button or the button list?
Peter.
-
Thanks Nico, That worked out great.
One other question - somewhat related that perhaps you might have an answer to. Is there a way, using a VB or C# script in the runtime modifications, to access the form object? I tried to set one up but couldn't see a way to add the form to the script parameters. When you define the objects to pass into the script, the list includes Form Items, etc. but not the form itself. What I'd like to do is avoid using many Assign activites by replacing them with a simple script that contained lines equivalent to all the Assign activities I'd need (one Assign for every form item label). Something along the lines of:
form.Find(Of TextBoxFormItem1).Label.Text = languageDictionary("degrees")
form.Find(Of TextBoxFormItem2).Label.Text = languageDictionary("minutes")
form.Find(Of TextBoxFormItem3).Label.Text = languageDictionary("seconds")This way I only need one script activity instead of many Assign's.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
1 Kommentar