21-01-2007, 08:57 PM
Well, earlier today someone (no names!) asked me about getting XP style components into his project.
To my suprise, he was actually using Candy Buttons (or something) which he had downloaded off Planet Source Code.
He was using it to create XP styled components in his application.
I think the main use of Candy buttons was to be able to create your own styled Components, rather than using XP styled ones.
So, have you ever thought of having XP components in your application?
Of course you have. (and if not, you should have done after reading that :lol
So, I am going to tell you how to not only have XP components in your .exe, but also how to enable it in IDE!
First up,
IDE
To allow you to have all the default components (well, most) be shown during development using the XP style, you do not need to add something to everything you create.
No,
We are going to create a manifest file in the VB98 folder!
This will change the way VB is shown on your screen, like so!
![[Image: example0nk.jpg]](http://img443.imageshack.us/img443/8291/example0nk.jpg)
Go to notepad,
Save in the same directory as VB6.exe as,
Now, that's better than ugly files been added to every project, more .dll dependencies and ugly modules, right?
Ooooh! Wow! It also changes the development bits, not just user-created components!
Ok. So everything you add into your project is now XP styled! Right?
Wrong!
Only to the developer.
The next bit will hardcode it into your project and make it appear like that to anyone who runs your application!
What.. wait?
Is that it?
Actually, no it's not.
Unfortunately we need to add a dependency
Sowwy, but shit happens.
You'll need to make a new manifest file for every project you make!
Nothing too big, no massive code changes.
The same .manifest file you saved with VB6.exe, but you must rename the
bit with the name of your .exe.
So if your .exe is called
your manifest file will need to be
Of course if you're clever (or lazy... or both actually.. :lol
you can make a program do it for you!
So now your application looks sleek, smooth and... well... modern.
To my suprise, he was actually using Candy Buttons (or something) which he had downloaded off Planet Source Code.
He was using it to create XP styled components in his application.
I think the main use of Candy buttons was to be able to create your own styled Components, rather than using XP styled ones.
So, have you ever thought of having XP components in your application?
Of course you have. (and if not, you should have done after reading that :lol

So, I am going to tell you how to not only have XP components in your .exe, but also how to enable it in IDE!
First up,
IDE
To allow you to have all the default components (well, most) be shown during development using the XP style, you do not need to add something to everything you create.
No,
We are going to create a manifest file in the VB98 folder!
This will change the way VB is shown on your screen, like so!
![[Image: example0nk.jpg]](http://img443.imageshack.us/img443/8291/example0nk.jpg)
Go to notepad,
Code:
Your application description here.
Save in the same directory as VB6.exe as,
Code:
vb6.exe.manifest
Now, that's better than ugly files been added to every project, more .dll dependencies and ugly modules, right?
Ooooh! Wow! It also changes the development bits, not just user-created components!
Ok. So everything you add into your project is now XP styled! Right?
Wrong!
Only to the developer.
The next bit will hardcode it into your project and make it appear like that to anyone who runs your application!
Code:
Private Declare Sub InitCommonControls Lib "comctl32.dll" ()
Private Sub Form_Initialize()
InitCommonControls
End Sub
What.. wait?
Is that it?
Actually, no it's not.
Unfortunately we need to add a dependency

Sowwy, but shit happens.
You'll need to make a new manifest file for every project you make!
Nothing too big, no massive code changes.
The same .manifest file you saved with VB6.exe, but you must rename the
Code:
VB6.exe
bit with the name of your .exe.
So if your .exe is called
Code:
xxxpron.exe
your manifest file will need to be
Code:
xxxpron.exe.manifest
Of course if you're clever (or lazy... or both actually.. :lol

So now your application looks sleek, smooth and... well... modern.