|
-
Jan 2nd, 2006, 03:52 AM
#1
Thread Starter
Fanatic Member
XP Theme... AGAIN! [UNRESOLVED]
ok...
I know this has been asked like 2,000 times... but I was wondering why XP themes don't work on my App...
I have used skybound and integrated visual style objects but it doesn't work in my project...
VB Code:
Public Sub New()
MyBase.New()
'Application.EnableVisualStyles()
'Application.DoEvents()
Skybound.VisualStyles.VisualStyleProvider.EnableVisualStyles()
InitializeComponent()
End Sub
I was wondering... How can I apply the visual styles on a single form, or on all forms I got...
Do I need to apply the
'Application.EnableVisualStyles()
'Application.DoEvents()
header before ALL the forms? (tried, doesn't work), on the single startup form (tried, still doesn't work)...
anyways, it's 4:00 am here, I'm gonna rest it and look it up again tomorrow!
-
Jan 2nd, 2006, 06:52 AM
#2
Re: XP Theme... AGAIN! [UNRESOLVED]
You need to make the call before any form is initialized or shown. Usually as the first lines of code work best.
For the skybound issue I would suggest a DoEvents maybe? If you apply the VS to a form it will apply to all forms in your app.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 2nd, 2006, 07:03 AM
#3
Re: XP Theme... AGAIN! [UNRESOLVED]
As Rob says, enabling visual styles has to be the first thing you do, so you should call either EnableVisualStyles method as the first line in a Main method. You would normally then call Application.DoEvents immediately after. Note that the call to DoEvents is only required if you use an ImageList somewhere in your app, but it's a good idea to include it by default regardless.
-
Jan 2nd, 2006, 11:25 AM
#4
Fanatic Member
Re: XP Theme... AGAIN! [UNRESOLVED]
I have not tested Skybound, but normally when you enable visual styles you have to set the FlatStyle property of the controls to 'System' otherwise they will keep their old-skool look.
Have you done this? (assuming it's necessary with skybound)
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
-
Jan 2nd, 2006, 01:36 PM
#5
Thread Starter
Fanatic Member
Re: XP Theme... AGAIN! [UNRESOLVED]
ya I did get my controls with flatstyle=system... I'll just add this app.doevents thing... wait up
-
Jan 2nd, 2006, 02:02 PM
#6
Thread Starter
Fanatic Member
Re: XP Theme... AGAIN! [UNRESOLVED]
nop, not workin'...
-
Jan 2nd, 2006, 05:51 PM
#7
Re: XP Theme... AGAIN! [UNRESOLVED]
If you are using Skybound VisualStyles then you are specifically NOT supposed to set the FlatStyle to System. You call the Skybound version of EnableVisualStyles, but it must be in your Main method. You then add a VisualStyleProvider object to each form that needs to make use of one. Everything else is taken care of for you. Mind you, I suggest specifically disabling the VisualStyleProvider support for those controls for which it will make no difference to speed up rendering. This would include Buttons with no image, for which you WOULD just use the FlatStyle property.
VB Code:
Public sub Main()
Skybound.VisualStyles.VisualStyleProvider.EnableVisualStyles()
Application.DoEvents()
Application.Run(New Form1)
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|