Define the defaults values of winform controls - winforms

I have an app(new app) to developpe, changing all values like Font style and TextBox height and other properties of all controls in application is so hard, can i fixing this in the for example app.conf! and how do i express that ?
For example:
i want to use Font Segio, 11 for all Label controls
RowHeight by default use 35 for all Grids-View in my application

You can set the font of the form(or their parent control) and all of its child controls will inherit the font of its parent.
Also you can read the font from config file and set that in you form.
Google "Reading from config file c#" if you don't know that yet.

Related

Menu/Toolbar color in WPF app

So I have a simple WPF app with a menu and a toolbar/toolbartray inside a Grid. By default, the colors don't match (the menu is grey and the toolbar is blue - see image)
I have tried specifically setting the background color but there are then other issues (toolbar overflow button colors and sub menu colors.)
Strikes me that by default, the colors should match and also match the system theme. Is there a magic setting? Surely I can't need to specifically style everything?
Thanks
Get default ControlTemplates of that controls.
Menu
ToolBar
Add new ResourceDictionary to your project and insert that templates
Change background properties in root Borders of templates.

Global winforms styling

Are there global styles in Winforms as there are in WPF?
I'd like to be able to, for example, set ForeColor to be used by all the labels that exist within the app. Is there any solution, or do I have to do the changes manually for all the controls separately?
Most controls will inherit the font from their parent - so try setting the font styles you want on the window.

How should I implement application-wide font size setting and dialog allowing a user to select that font size?

I need to implement Options dialog, allowing user to change font size (and some more parameters). How should I do this if these settings should be application-wide, and somehow globally bounded to all controls, without copy-pasting binding to these settings in every view?
You could create a style for your controls in which you bind these properties via DynamicResource to a value definied in some ResourceDictionary merged with your App.xaml. This value can then be altered by Application.Current.Resources["Key"].

Set Image colours while theme change

In WP7 suppose we are having a TextBlock with Foreground as DEFAULT and we change the theme of phone than foreground will be adjusted automatically so that its(TextBlock's) text can be seen properly with any theme . Is there any way to do same to some if we are having image kind of control so that the control can be seen with any available THEME of WP7 in proper OR presentable manner
Yes, you can adjust the image to the dark/light theme, using the PhoneDarkThemeVisibility and PhoneLightThemeVisibility resources. I would suggest using a ValueConverter.
You can read more on MSDN

How do I set the theme for child controls with Infragistics?

I'm using the Infragistics WPF controls in a new project, and I'd like to take advantage of their themes support. I'm able to change the theme of my window (and toolbars) via the OnThemeChanged event, but I can't figure out how to change the theme of child controls (such as the XamDockManager), as they're added at runtime.
I'm new to WPF and Infragistics controls so any clarification is appreciated.
I discovered the answer.
You need to set the control's Theme property to Theme.CurrentTheme. This will cause the controls to automatically pick up the new theme via their internal OnThemeChanged events.
This is the code I used, simplified a bit for this answer:
<igDock:ContentPane xmlns:igTheme="clr-namespace:Infragistics.Windows.Themes;assembly=Infragistics3.Wpf.v9.1">
// other stuff
...
<igDock:XamDockManager "Theme="igTheme:ThemeManager.CurrentTheme" />
</igDock:ContentPane>

Resources