Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XP icon style in VB6? 3

Status
Not open for further replies.

eman6

Programmer
Dec 7, 2004
578
CH
Is it possible to use XP button styles in VB6.
I am not even sure if it is a standards in VB 7, but for now I would like to use the XP style in VB6, if possible.


_______________________________________
Yesterday I bought [Sweet Chilli Source for Chicken].
I added this to the food I gave to the chicken, but they did not like it.

Eman_2005
Technical Communicator
 
Do a keyword search in this forum for XP manifests (and make sure you read the caveats ...)
 
I would recommend using a manifest file. You can use these in the deployed app and in your IDE. Do a search on this site for XP Manifest and you should find several examples of the files you need to include.

Hope this helps

Harleyquinn

---------------------------------
For tsunami relief donations
 
Thank you (both) for this quick reply.
I had a look and decided to leave this for a later time.
I would have done it immediately if it was some straightforward trick, though.
It is interesting nevertheless.

Is this style used by default in VB7 (what a silly question. Right?)

Because sooner or later I will have to upgrade my app to VB7 anyway, so maybe I better wait.

_______________________________________
Yesterday I bought [Sweet Chilli Source for Chicken].
I added this to the food I gave to the chicken, but they did not like it.

Eman_2005
Technical Communicator
 
VB7 !?

________________________________________
Zameer Abdulla
Visit Me
The best thing to spend on your child is your time.
 
bah, seems pretty straightforward to me.

Copy this into notepad and save the file as YourFile.exe.Manifest and place it in the same folder as your exe then run the exe.

<?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="HybridDesign.WindowsXP.Some App" type="win32" /> <description>An example of windows XP theming.</description> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" /> </dependentAssembly> </dependency> </assembly>



Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
True
I just did not like the fact that it works not in design time, but only in runtime.

Thanks.

_______________________________________
Yesterday I bought [Sweet Chilli Source for Chicken].
I added this to the food I gave to the chicken, but they did not like it.

Eman_2005
Technical Communicator
 
Try this, save it as vb6.exe.Manifest and place it in C:\Program Files\Microsoft Visual Studio\VB98 or where ever vb is installed on your system then restart the project:)



Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
I did.
No difference at all.
Even when I run the project, all stays as before :-((

_______________________________________
Yesterday I bought [Sweet Chilli Source for Chicken].
I added this to the food I gave to the chicken, but they did not like it.

Eman_2005
Technical Communicator
 
Well - it ought to (I realise that doesn't help you, though ...)

Can you confirm exactly where you placed the vb.exe.manifest file?

 
If you save the above xml as vb6.exe.manifest and place it in the folder where the vb6.exe exist and then completely close visual basic and reopen it, then the xp styles will be available within the IDE.



Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
I just applied to this to my computer. It works great. however, when picking back/fore colors I can no longer view the color palette. And thoughts?


Thank you

John
 
See:

I put it where the vb6.exe is.
I put this:
<?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="HybridDesign.WindowsXP.Some App" type="win32" /> <description>An example of windows XP theming.</description> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" /> </dependentAssembly> </dependency> </assembly>

in notepad and saved it as vb6.exe.manifest
did I miss something? Because nothing changed AT ALL.

Yet, this did not change anything.

From one of the links I saw there was some code to add and not just the manifest file in the vb6 folder.

_______________________________________
Yesterday I bought [Sweet Chilli Source for Chicken].
I added this to the food I gave to the chicken, but they did not like it.

Eman_2005
Technical Communicator
 
eman2005, you are not using XP and if you are you do not have it set up in classic view, I can see this from your screen shot, what OS are you running?




Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Johnblaze1, that is a problem, in your own app you need to place controls such as OptionButtons and CheckBoxes in a picture box to get them to display properly. I'm not sure of how to get the color dialog to display properly while the theme is on other than rename the manifest and restart VB.



Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Some of the links are ... erm ... overcomplicated

In general you only need the manifest. The library initialisation code (InitCommonControls/InitCommonControlsEx - which is what you have seen) is only required if your application is not already linked to ComCtl32.dll

The IDE is so linked, so the initialisation code isn't required. Your VB application may not be, so the compiled version will not adopt the XP style unless the initialisation code is included or - and this is perhaps easier - invisibly add a single control from Windows Common Controls to the first form that is to be made visible.

It is also worth being aware that you should use the Common Controls 5.0 (rather than 6.0) if you want things like the statusbar, slider control and toolbar to adopt the XP style (see my brief comment as to why here thread222-799689)
 
I have Windows XP SP2
and the Start menu is NOT in Classical view.

After all, it obviously isn't THAT straightforward, is it.

_______________________________________
There are three different kinds of people:
Those who can count, and those who cannot.

Eman_2005
Technical Communicator
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top