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;
        }

    }
}

Используя этот сайт, вы соглашаетесь на использование файлов Cookie для аналитики и персонализированного контента. Файлы Cookie хранят полезную информацию на вашем компьютере, чтобы помочь нам повысить эффективность и удобство использования. Для получения дополнительной информации, пожалуйста, прочтите Конфиденциальность и Использование Cookie.