XP Style controls

Add-in Express™ Support Service
That's what is more important than anything else

XP Style controls
 
Thomas Grossen




Posts: 134
Joined: 2005-10-21
Does anybody know what to do to enable XP Styles controls in Add-in modules? I need to open a window that have and "XP style"

I have tried a lot of things like this...

http://support.microsoft.com/default.aspx?scid=kb;en-us;830033

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsapplicationclassenablevisualstylestopic.asp

https://forums.microsoft.com/msdn/ShowPost.aspx?PostID=52926


... but I could not get it working!

If anybody has an idea... Manny thanks!


Thomas.
Posted 26 Oct, 2005 09:52:59 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Thomas.

Do you want to enable XP styles for Outlook? If so then create a new file called outlook.exe.manifest in the Outlook installation folder and put the following text into the file:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<description>Outlook manifest</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>


Posted 26 Oct, 2005 10:16:16 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
By the way, I have just tested the example described by the link that you have sent (http://support.microsoft.com/default.aspx?scid=kb;en-us;830033) and it works fine for me. I suppose you've fogotten to set the FlatStyle property of your controls to System.
Posted 26 Oct, 2005 10:39:48 Top
Thomas Grossen




Posts: 134
Joined: 2005-10-21
1) It is strange; it works for some controls like listView & combo, but not for buttons and check box…

2) Is this the "correct" (or unique) way to do it? What about the client installation? I have other Add-in installed on my computer, and they have "XP Style" without the manifest file.

3) I heard that "XP Style" will be automatic with VisualStudio .NET 2005. Do you know something about it?

Thanks.

Thomas.
Posted 26 Oct, 2005 10:39:59 Top
Thomas Grossen




Posts: 134
Joined: 2005-10-21
I have tested again the sample I sent before, and you where right, I did not set the FlatStyle to System... So, it works fine.

Same thing with the manifest file.
Thomas.
Posted 26 Oct, 2005 10:58:47 Top
Thomas Grossen




Posts: 134
Joined: 2005-10-21
Sergey,

Do you know a way to enable XP styles in the Option Page without using the manifest file, I mean doing it like in the sample we talk before (http://support.microsoft.com/default.aspx?scid=kb;en-us;830033)?

This works fine for other windows.

Thank you,

Thomas.
Thomas.
Posted 30 Nov, 2005 05:06:40 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Thomas.

I think no. The fact is that your option page is created by Outlook once
and there is no way to enable XP styles in the ADX code. I tested this example in the OptionsPagesAdd event handler in ADX and it didn't work.
Posted 30 Nov, 2005 10:50:15 Top
Thomas Grossen




Posts: 134
Joined: 2005-10-21
ok... so we need to use the manifest file, but this looks not very "professional"...

Thanks for your testing.

Thomas
Thomas.
Posted 30 Nov, 2005 11:05:10 Top
Ulrich Koehncke


Guest


Hi Thomas

It seems to be no problem to use visual styles in an option page using vs 2005. The problem is the background of the tabpage which is incorrect colored. For this I have override the DrawBackground function. Here you have to draw the themed background.

Regards

Ulli
Posted 02 Dec, 2005 07:13:09 Top
Thomas Grossen




Posts: 134
Joined: 2005-10-21
Dear Ulrich,

Thank you for your input. I am acutally using vs 2003. I was not planning an upgrade to vs2005 yet, but if XP Styles are working better, I will upgrade soon.

Thank you,

Thomas.
Thomas.
Posted 02 Dec, 2005 07:50:54 Top