This is a migrated thread and some comments may be shown as answers.

RadForm title alignment

4 Answers 398 Views
TitleBar
This is a migrated thread and some comments may be shown as answers.
Nathalie
Top achievements
Rank 1
Nathalie asked on 05 Sep 2014, 10:18 AM
Hello,


How can I center the title of my RadForm?

Thanks.

4 Answers, 1 is accepted

Sort by
0
Mark
Top achievements
Rank 1
answered on 27 Jun 2015, 01:19 AM
A was a very informative answer to this straightforward question
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 01 Jul 2015, 01:19 PM
Hello Nathalie,

Thank you for writing.

In order to center the text in the title-bar, you can use the following code snippet:
public Form1()
{
    InitializeComponent();
 
    this.FormElement.TitleBar.TitlePrimitive.StretchHorizontally = true;
    this.FormElement.TitleBar.TitlePrimitive.TextAlignment = ContentAlignment.MiddleCenter;
}

I hope this information helps. Should you have further questions, I would be glad to help.
 
Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Ashish
Top achievements
Rank 1
answered on 17 Apr 2019, 12:50 AM
The following code doesn't work for the RadForm's title-text alignment. I am using the Crystal theme.

this.FormElement.TitleBar.TitlePrimitive.StretchHorizontally = true;
this.FormElement.TitleBar.TitlePrimitive.TextAlignment = ContentAlignment.MiddleLeft;
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 17 Apr 2019, 07:54 AM
Hello, Ashish,     

Note that in Crystal theme, the title-bar is in right-to-left mode. That is why setting the TitlePrimitive.TextAlignment property to left doesn't have effect. Feel free to set it to ContentAlignment.MiddleRight in order to obtain the following result:

ThemeResolutionService.ApplicationThemeName = "Crystal";
 
this.FormElement.TitleBar.TitlePrimitive.StretchHorizontally = true;
this.FormElement.TitleBar.TitlePrimitive.TextAlignment = ContentAlignment.MiddleRight;



I hope this information helps.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
TitleBar
Asked by
Nathalie
Top achievements
Rank 1
Answers by
Mark
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Ashish
Top achievements
Rank 1
Share this question
or