![]() |
XP Styles in VB - Printable Version +- Mirage Source (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49) +---- Thread: XP Styles in VB (/showthread.php?tid=666) |
XP Styles in VB - Robin - 21-01-2007 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! ![]() 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" () 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. - Xlithan - 24-01-2007 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. - Tony - 24-01-2007 hmm How'd you make the form name colored, Kite? - Robin - 24-01-2007 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. - Xlithan - 24-01-2007 i'l keep mine as is then. Mine doesn't need a manifest file like yours, it runs strait from a module. - funkynut - 24-01-2007 Does that module happen to create its own manifest =p - Tony - 11-02-2007 This thing actually F's up some things in Vb6. |