Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
475
Find all infragistics controls on a form
posted

Hi,

I want to set "StyleLibraryName" property to all infragistics controls on a specific form. Is there any way (like looping or else) without setting this property individually.

Thanks,

Bharat Jangir

Parents
No Data
Reply
  • 475
    Verified Answer
    posted

    for solution, i am using this code:

    private void InitializeComponent()
    {
        SetThemePropertyToInfragisticsControls(this);
    }


    public void SetThemePropertyToInfragisticsControls(Control control)
    {
           PropertyDescriptorCollection tempObject = TypeDescriptor.GetProperties(control);
           PropertyDescriptor tempObjectProperty = tempObject.Find("StyleLibraryName", true);
           if (tempObjectProperty != null)
           {
                tempObjectProperty.SetValue(control, "TempTheme");
           }

           foreach (Control child in control.Controls)
           {
                SetThemePropertyToInfragisticsControls(child);
           }
    }

Children
No Data