Posted 9 January 2024, 5:43 am EST - Updated 9 January 2024, 5:48 am EST
RibbonForm TItle issue
Posted by: fabio.lavitola on 9 January 2024, 5:43 am EST
-
-
Posted 9 January 2024, 11:54 pm EST - Updated 10 January 2024, 3:08 pm EST
Hello,
We are sorry, but there is no direct way to change the height of the TitleBar in WinForms or C1RibbonForm.
You’ll have to create a C1Theme and set the desired height of the TitleBar by changing the ‘C1Ribbon > Form > Title > TitleHeight’ property in C1ThemeDesigner. Please refer to the attached image (TitleBarHeight.zip).
Please refer to the attached sample for implementation. (see RibbonForm48_TitleBar.zip)
For more information on C1ThemeDesigner and C1Theme please refer to Themes for WinForms in docs. [https://developer.mescius.com/componentone/docs/win/online-themes/overview.html]
Regards,
Uttkarsh. -
Posted 10 January 2024, 12:29 am EST
Creating a new theme (based on another Dark one) has solved, thank you!
-
Posted 10 January 2024, 3:08 pm EST
Hello,
We are glad that we were able to resolve your query.
If you require any further assistance or have any questions, please do not hesitate to reach out to us.
Regards,
Uttkarsh. -
Posted 10 January 2024, 8:14 pm EST
Hi Fabio,
you could also modify an existing theme on the fly in your code and change specific theme properties. This way, you could avoid creating a custom theme (which might get out of sync with the standard theme provided by C1). If you are interested, I could try to find out a code snippet.
For a start: here is a snippet that we use to change a C1FlexGrid theme property - it hopefully gives you an idea on how to modify theme properties:
BackgroundProp propHeader = (BackgroundProp)this.theme.Children.GetItemByPath("C1FlexGrid\\Styles\\SelectedColumnHeader\\Background"); propHeader.Value = new ThemeSolidBackground(Color.Khaki);
Best regards
Wolfgang
-
Posted 15 January 2024, 7:41 pm EST
Hello,
Wolfgang Thank you for your suggestion.
Fabio, you can also update the theme at runtime using the following code:C1Theme customTheme = C1ThemeController.GetThemeByName("CustomTitleBarTheme", false); IntProp titleHeight = (IntProp)customTheme.Children.GetItemByPath("C1Ribbon365\\Form\\Title\\TitleHeight"); titleHeight.Value = 100; C1ThemeController.ApplyThemeToControlTree(this, customTheme);
To get the path to the property, follow the following steps:- open C1ThemeDesigner
- under ThemeTree, right-click on C1Ribbon > Form > Title > TitleHeight property
- click on “Copy Name”, then “Name” to copy the path.
Please refer to the attached sample for implementation. (see RibbonForm48_TitleBar_RunTime.zip)
Regards,
Uttkarsh.