Find a form element by name, change its text and font in code, and send the updated form to the web component.

Finding the element. The form is loaded once and the required component is resolved by name, so the rest of the definition remains unchanged.

Updating its appearance. In Changing Properties from Code/Controllers/FormsController.cs, the controller changes only the text and font properties before serializing the form for the browser:
private StiForm ChangeFormProperties(StiForm form)
        {
            var labelCompanyName = form.GetElementByName("CompanyName") as StiLabelElement;
            labelCompanyName.Text.Expression = "My Company";
            labelCompanyName.Text.Font = new System.Drawing.Font("Arial", 20);

            //Save-load form just for sample
            var savedForm = form.SaveToString();

            var loadedForm = new StiForm();
            loadedForm.LoadFromString(savedForm);

            return loadedForm;
        }

    }
}

By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.