When you want to use a different skin theme for your DevExpress Winform control but it still doesn't change when you run it, try doing these:
1. Go to your project properties and click on the "View Applicaiton Events"
2. Select "MyApplicationEvents" - "Startup" and under your startup procedure add these codes:
DevExpress.UserSkins.BonusSkins.Register()
DevExpress.Skins.SkinManager.EnableFormSkins()
DevExpress.Skins.SkinManager.EnableMdiFormSkins()
Example:
Imports Microsoft.VisualBasic.ApplicationServices
Namespace My
' The following events are available for MyApplication:
' Startup: Raised when the application starts, before the startup form is created.
' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally.
' UnhandledException: Raised if the application encounters an unhandled exception.
' StartupNextInstance: Raised when launching a single-instance application and the application is already active.
' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected.
Partial Friend Class MyApplication
Private Sub MyApplication_Startup(sender As Object, e As StartupEventArgs) Handles Me.Startup
DevExpress.UserSkins.BonusSkins.Register()
DevExpress.Skins.SkinManager.EnableFormSkins()
DevExpress.Skins.SkinManager.EnableMdiFormSkins()
End Sub
End Class
End Namespace
3. Now go to your Windows form designer and add a component called "DefaultLookAndFeel" and then select the skin theme that you want to use. Compile and run your solution and it should work.
I tried all other solutions suggested from different postings but this one worked for me.
No comments:
Post a Comment