There seems to be a problem with enabling XP style (EnableVisualStyles) and toolbars, i.e. the buttons will not display images. Has anyone solved this/found a work around???
Printable View
There seems to be a problem with enabling XP style (EnableVisualStyles) and toolbars, i.e. the buttons will not display images. Has anyone solved this/found a work around???
The support for XP Visual Styles is not well-implemented in .NET Framework 1.1. You should use the manifest file instead of using EnableVisualStyles().
Zembaliti
Hate to sound dense here, but do you know of an example that shows how to do this? I tried creating a app.exe.manifest file and added it to the project but that didn't work. And, as usual, I'm looking in all the wrong places in the online help....
TIA, for any help.
save this as file named ::: yourApp.EXE.MANIFESTCode:<?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="Microsoft.Windows.Your_App_Name_Here_Without_EXE"
type="win32"
/>
<description>Your app 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>
off you go
Actually, it was more of the last bit contained in "off you go"... i.e. the only way I could figure to get this to work was to insert the .manifest file in the same location as the exe. Is there any way to "embed" it in the app itself?
embedding the file doesnot gave anything good as far as i worked on the issue.
so, when i create deployment project, i simply add manifest file and place it next to my application exe.
no other way as such.
I even worked with Enable visual styles function but when you run the program on W2K or NT, it returns error and the application goes head down. so, if you want to include visual styles and you are sure that no one is going to the app on w2k or NT. you can go for enablevisualstyles function and it works pretty fine. (only on XP)...
It may work fine for most things on XP but for some reason the toolbars don't display images. I tried using a imagelist with images placed in the wizard, and loading (.AddStrip) a stirp af images from an embedded resource. Neither set of images would show. Hmm, maybe I should try just loading the image strip at run time...
Another strange thing is that if you use the wizard to put images in the image list, use it with a verticle toolbar, and dock on top and bottom, the image will not display...
you have to check whether AutoSize property of toolbar is set to true.
the images are displayed as it is in my projects. I face problems when i put text and change between show Below and show Right.
embed a manifest file into exe
A Win32 resource must be added to your .exe. The type of the resource must be "RT_MANIFEST" and the resource id must be "1". An easy way to do this is with Visual Studio.NET:
1. Open your exe in VS (file -> open file)
2. Right click on it and select add resource
3. Click "Import..." from the dialog
4. Select your manifest file
5. In the "Resource Type" field, enter "RT_MANIFEST"
6. In the property grid, change the resource ID from "101" to "1".
7. Save the exe.
Application.DoEvents();
Right after enable visual styles.