With reflection, you can get all the controls in the current form and set their properties as needed.
Font Defaultfont =NewSystem.Drawing.Font ("Microsoft Sans Serif", 8.25F);//Find all controls, set to the same fontIteratecontrols ( This. Controls,typeof(Foundation.WinUI.Misc.Label));foreach(Control Ctrlinchgrids) {Ctrl. Font = Defaultfont;} grids =NewList<control> (); Iteratecontrols ( This. Controls,typeof(Foundation.WinUI.Misc.TabControl));foreach(Control CtrlinchGrids) {foreach(Ultratab tabinch(Ctrl asFoundation.WinUI.Misc.TabControl). Tabs) {tab. Appearance.FontData.Name = Defaultfont.name; tab. Appearance.FontData.SizeInPoints = defaultfont.sizeinpoints; }}grids =NewList<control> (); Iteratecontrols ( This. Controls,typeof(Foundation.WinUI.Editors.CheckBoxEditor));foreach(Control Ctrlinchgrids) {Ctrl. Font = Defaultfont;}
Gets the method for the specified type of control:
Private void Iteratecontrols (Control.controlcollection controls, type type) { foreach in controls) { if (child. GetType () = = type) grids. ADD (child); if (Child. HasChildren) iteratecontrols (child. Controls, type);} }
The code comes from StackOverflow.
To set the properties of a control in a form