Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
XP Styles in VB
#1
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 :lolSmile

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]

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 Sad

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.. :lolSmile you can make a program do it for you!

So now your application looks sleek, smooth and... well... modern.
Reply
#2
Not forgetting to mention buttons do not work on frames, frames do not work inside other frames, and you can see controls flickering when you move over them (On textboxes mostly)

That's unless this is a recent and fixed version. I think the VB5 controls work better with this manifest.

I added this to M:RPGe 2 ages ago.

http://mrpge.chronicalgames.com/images/ ... ttings.jpg

I may give this version a try and see if it works, because adding XP Style to the mirage source client stops it from working properly (At all infact), but it runs nicely on the server.
Reply
#3
hmm How'd you make the form name colored, Kite?
Reply
#4
Those colours are default.

Also, not sure about the controls flickering but it works fine for me (except frames within frames and CButtons within frames, but I just put everything in a picture box and overlay everything anyway, sooo...)

Don't know if it works with Mirage, never changed it, but it works fine in the app.s which I have added it to.
Reply
#5
i'l keep mine as is then. Mine doesn't need a manifest file like yours, it runs strait from a module.
Reply
#6
Does that module happen to create its own manifest =p
Reply
#7
This thing actually F's up some things in Vb6.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)