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
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
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
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
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