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

Changing TitleBar colour of a RadForm

5 Answers 327 Views
TitleBar
This is a migrated thread and some comments may be shown as answers.
Shaun
Top achievements
Rank 1
Shaun asked on 19 Sep 2012, 10:00 PM
Hi,

I'm in the process of evaluating your winform controls and I'm trying to emulate the way the demo app hub changes the title bar of a form, size and colour. For example when selecting the Grid Example the header is about 80 high, dark blue with a back button.

The app I created has a simple Radform and Rad Data View, on load I try to change the TitleBar, but I must be doing something wrong.
I can change the background colour but the background of the system buttons stay the same.

Here's a snippet 
           this.FormElement.TitleBar.Size = new System.Drawing.Size(this.Width, 100);
            this.FormElement.TitleBar.FillPrimitive.BackColor = Color.DarkBlue;
            this.FormElement.TitleBar.CloseButton.ImagePrimitive.BackColor =  Color.Transparent;

I has also tried to create a new RadTitleBarElement, but the out come is the same.

I know I'm missing something simple here so can you point me in the right direction?

Cheers
Shaun.

5 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay
Telerik team
answered on 20 Sep 2012, 09:38 AM
Hi Shaun,

Thank you the question.

The minimize/maximize/close buttons are controlled by images, so regardless of the color setting that you apply, you are again observing the same style and behavior. You can edit the buttons states removing the images by using our Visual Style Builder tool. Here you can read more about loading our predefined themes in case you want to start from an existing theme.

Alternatively, if you are happy with the images that appear by default when the mouse is not over and not down on the buttons, you can override the MouseOver and MouseDown images set by theme by explicitly setting the default image in code like this:

this.FormElement.TitleBar.CloseButton.ImagePrimitive.Image = this.FormElement.TitleBar.CloseButton.ImagePrimitive.Image;

In addition, you might want to set the border to the same DarkBlue color as the fill. Moreover, in order to increase the height of the titlebar, I would recommend setting its Padding to an appropriate value:
this.FormElement.TitleBar.Padding = new Padding(0, 50, 0, 50);
this.FormElement.TitleBar.FillPrimitive.BackColor = Color.DarkBlue;
 
this.FormElement.TitleBar.FillPrimitive.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
this.FormElement.TitleBar.BorderPrimitive.BoxStyle = Telerik.WinControls.BorderBoxStyle.SingleBorder;
this.FormElement.TitleBar.BorderPrimitive.ForeColor = Color.DarkBlue;

I hope this helps. Let me know if you need additional assistance.

Regards,
Nikolay
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Muhammad
Top achievements
Rank 1
answered on 30 Sep 2016, 05:12 AM

hi shaun 

thankyou for the answer 

but i have a question about radTitleBar 

how i can change its background colour

default is gray but i want to set its colour blue

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 04 Oct 2016, 07:46 AM
Hello Muhammad,

Thank you for writing.  

In order to change the back color for RadTitleBar, you can use the following code snippet:
1.this.radTitleBar1.TitleBarElement.TitleBarFill.BackColor = Color.Yellow;
2.this.radTitleBar1.TitleBarElement.TitleBarFill.GradientStyle = Telerik.WinControls.GradientStyles.Solid;

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Ras Ran
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 03 Dec 2018, 11:16 AM
hii first of all see the attached picture...here its child form is in the outside of the mdi form...i want to hide that horizontal and vertical scrollbars in this condition .....is it possible ? 
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 04 Dec 2018, 08:57 AM
Hello, Raneesras,    

By default, when the MDI child is moved to a location that exceeds the bounding rectangle of its parent, the respective scrollbars appear in the MDI parent form. This is standard behavior for the MDI scenario and the Microsoft Form also observes it. If you wish to hide these scrollbars, you can refer to the following general programming forum threads:

https://www.codeproject.com/Questions/713819/How-to-remove-scroll-bars-in-MDI-form-and-to-fit-c
https://social.msdn.microsoft.com/Forums/en-US/edfe9dca-042f-4f88-9ec0-77d50fee37a2/eliminating-mdi-parent-form-scrollbars?forum=winforms

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
Shaun
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Muhammad
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Ras Ran
Top achievements
Rank 2
Iron
Veteran
Iron
Share this question
or