Best Practices for mixing SF themed controls with DevExpress controls


Author
Message
Kirk M Sherhart
Kirk M Sherhart
StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)
Group: Forum Members
Posts: 41, Visits: 259
I'm hoping that any developers who have used SF themed controls in combination with DevExpress controls would share their experience about what works, what doesn't work, etc. Trying to mix and maintain two separate theme-worlds is a bit confusing for this SF/DevExpress newbie!



Any help to avoid reinventing the wheel is greatly appreciated. Thx!
Juan Carlos Pazos
Juan Carlos Pazos
StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)
Group: Forum Members
Posts: 144, Visits: 227
Hi

I use SF and DevExpress controls in my application. For use properly the SF Themes and in order that DevExpress controls take the "look" similar to the SF theme I use this

In the main form of the application I put a RegistryRepository control that use for mantein the value of the current selected theme.

A constant in form level like this:

Private Const TemaAplicacion As String = "1"

Then this routine that read the registry value and load the SF theme, then I match the SF theme with one similar to DevExpress themes, this way if theme in SF is one of the two black themes I pick up a similar for DevExpress.

Notice that doing this way, you not need to define a theme for DevExpress controls in other forms, as this is the main form, all forms you use and open will use this same theme. This is just visible in runtime mode.

''' <summary>

''' Default Constructor

''' </summary>

''' <remarks></remarks>

Public Sub New()

' This call is required by the Windows Form Designer.

InitializeComponent()

'-- For load theme

Me.ApplicationTheme.Theme = CType(Me.RegistryTema.ReadString(TemaAplicacion, "9"), MicroFour.StrataFrame.UI.Windows.Forms.ApplicationThemeName)

Select Case Me.ApplicationTheme.Theme

Case 0

AssignCheck(tsBtnWindowsColors)

DevExpress.LookAndFeel.UserLookAndFeel.Default.SkinName = "Money Twins"

Case 1

AssignCheck(tsBtnBlackIce)

DevExpress.LookAndFeel.UserLookAndFeel.Default.SkinName = "Black"

Case 3

AssignCheck(tsBtnSinTema)

DevExpress.LookAndFeel.UserLookAndFeel.Default.SkinName = "Blue"

Case 4

AssignCheck(tsBtnBlackout)

DevExpress.LookAndFeel.UserLookAndFeel.Default.SkinName = "Black"

Case 5

AssignCheck(tsBtnWindowsRefracted)

DevExpress.LookAndFeel.UserLookAndFeel.Default.SkinName = "Money Twins"

Case 6

AssignCheck(tsBtnBlueSkies)

DevExpress.LookAndFeel.UserLookAndFeel.Default.SkinName = "Blue"

Case 8

AssignCheck(tsBtnSandDunes)

DevExpress.LookAndFeel.UserLookAndFeel.Default.SkinName = "Caramel"

Case 9

AssignCheck(tsBtnCoolBreeze)

DevExpress.LookAndFeel.UserLookAndFeel.Default.SkinName = "Blue"

Case Else

AssignCheck(tsBtnSandDunes)

DevExpress.LookAndFeel.UserLookAndFeel.Default.SkinName = "Black"

End Select

'-- Add handlers

AddHandlers()

End Sub

For the AddHandlers function (last line in the past routine) this is the code:

'-- Aade manejadores de evento

Private Sub AddHandlers()

AddHandler SecurityBasics.CurrentUserChanged, AddressOf HandleCurrentUserChanged

End Sub

I have a menu bar and one of the options is a select the theme, you can find a sample to do this in the SF samples.

Kindest regards

Smile Everything is possible, just keep trying...

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search