| Mirage Source http://www.miragesource.net/forums/ |
|
| XP Styles in VB http://www.miragesource.net/forums/viewtopic.php?f=210&t=1203 |
Page 1 of 1 |
| Author: | Robin [ Sun Jan 21, 2007 8:57 pm ] |
| Post subject: | XP Styles in VB |
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 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!
Go to notepad, Code: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="CompanyName.ProductName.YourApp" type="win32" /> <description>Your application description here.</description> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" /> </dependentAssembly> </dependency> </assembly> 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.. So now your application looks sleek, smooth and... well... modern. |
|
| Author: | Xlithan [ Wed Jan 24, 2007 2:50 am ] |
| Post subject: | |
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. |
|
| Author: | Tony [ Wed Jan 24, 2007 3:25 am ] |
| Post subject: | |
hmm How'd you make the form name colored, Kite? |
|
| Author: | Robin [ Wed Jan 24, 2007 4:34 pm ] |
| Post subject: | |
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. |
|
| Author: | Xlithan [ Wed Jan 24, 2007 4:49 pm ] |
| Post subject: | |
i'l keep mine as is then. Mine doesn't need a manifest file like yours, it runs strait from a module. |
|
| Author: | funkynut [ Wed Jan 24, 2007 6:27 pm ] |
| Post subject: | |
Does that module happen to create its own manifest =p |
|
| Author: | Tony [ Sun Feb 11, 2007 6:11 am ] |
| Post subject: | |
This thing actually F's up some things in Vb6. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|