views:

21

answers:

1

Hi all. I have a WPF application that has a variable "x" which is an instance of a class from a custom C# assembly called "MyClasses.dll". This variable "x" has a method "LaunchForm" that launches a Windows Form "Form1" from another assembly "MyForms.dll". The form is launched as a dialog and shown in the screen but the current Windows XP / Win7 theme/skin is not applied to it. If this "Form1" is launched from a Windows Form (not WPF window) it is shown correctly though. Any ideas why this is happening? Any hints to solve this issue?

Cheers all! Edgar

I just looked at the code again and I'm not using reflection on this way of launching the winform. The code as requested is in WPF:

MyInterface x=new MyClass1(); x.LaunchForm();

The code in MyClasses.dll:

public class MyClass1() : MyInterface { public MyClass1() {} public void LaunchForm() { Form1 Form1Dialog=new Form1(); Form1Dialog.ShowDialog(); } }

This, as mentioned, launches the winform from WPF but no windows theme is applied to it.

A: 

Probably you don't have the proper manifest to tell Windows you are compatible with the new theme (WPF doesn't need it).

I wrote about it on my blog at http://www.nbdtech.com/Blog/archive/2008/06/16/The-Application-Manifest-Needed-for-XP-and-Vista-Style-File.aspx

Nir
Nir, thanks for your help. Your article did help to enable the themes in my dialogs. The solution: a manifest had to be added to the application indicating the dependency for Microsoft Windows Controls.
Dogzilla