I'm trying to add a button in the Titlebar, I would like to give it the same aspect than the other buttons but I'm unable to do it, see:
Notice that my new button has a shiner color than the others and also the size protrudes out the yellowed border.
This is the code that I'm using:
Imports Telerik.WinControls.UI
Public Class RadForm_TestForm : Inherits RadForm
Public Sub New()
' This call is required by the designer.
InitializeComponent()
' Set the RadForm design.
With Me
.ThemeName = "VisualStudio2012Dark" ' The visual theme.
.FormElement.Border.ForeColor = Color.Gold ' Set the borders color.
.FormElement.Border.Width = 1I ' Set the borders width.
.FormElement.TitleBar.BorderPrimitive.ForeColor = Color.Red
.FormElement.TitleBar.ForeColor = Color.LightGray ' Set the TitleBar text color.
.FormElement.TitleBar.MinimizeButton.Enabled = False
End With
' Create a RadButtonElement.
Dim SystrayButton As New RadButtonElement()
With SystrayButton ' Set the RadForm design.
.Text = "."
.ShowBorder = False
.AutoSize = False
.Size = Me.FormElement.TitleBar.MinimizeButton.Size
' .ButtonFillElement.BackColor = Me.FormElement.TitleBar.MinimizeButton.BackColor
End With
' Add the Button in the TitleBar.
Me.FormElement.TitleBar.Children(2).Children(0).Children.Insert(0, SystrayButton)
End Sub
End Class
Notice that in the code above this line is disabled:
.ButtonFillElement.BackColor = Me.FormElement.TitleBar.MinimizeButton.BackColor
Because if I change the color in that way, if I put the mouse over the button it does not change the color when it is focused.
Update:
Maybe a solution could be applying the same theme of my RadForm
on the RadButtonElement
?
I've read this: http://www.telerik.com/forums/apply-theme-to-radbuttonelement
...but I really don't understand how to do it, I don't have any 'DefaultStyleBuilder' and I can't find info in telerik about what means that.