Subscribe:

Ads 468x60px

Pages

Monday, April 4, 2011

Add XP Style to Your VB6 Application

As we know, although our VB6 application run on Windows XP, it's still not using XP style. This article shows you a very simple way to add XP style to your VB6 application.

1. First, add component Microsoft Windows Common Controls 6.0 (SP6) (Mscomctl.ocx) to your project.
Project > Components > check on Microsoft Windows Common Control 6.0 (SP6) > click OK

2. Then, put any of its control to your Startup Object.
To know your Startup Object, click Project > Properties > tab General.
Lets say we put a StatusBar to your Startup Object. You may set it to be unvisible.

3. Design your form now.


4. Compile your project. File > Make .exe.


5. At last, we create a manifest file.
Open Notepad, copy paste below 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="XP-Style" type="win32" />
<description></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 it with name: [your-application-name].exe.manifest.
Lets say your application name is: Test.exe. Then you must save it as: Test.exe.manifest.

6. Finish.


Result:


Some Notes
- XP Style do not apply during design time, only at run time. (Learn how to activate XP style during design time here).
- Option buttons do not seem to draw correctly when placed on a frame. You must place your option buttons onto a picture box.

1 komentar:

Taha Okla said...

Useful information
Thanks ..

Post a Comment