Aks
Aks

Reputation: 5236

Theming dialog windows in WPF

I've noticed the OpenFileDialog or the Window have the classic theme set. How do I force them to use the Aero theme?

Upvotes: 0

Views: 586

Answers (2)

Nir
Nir

Reputation: 29614

I've wrote about it on my blog a long time ago, short version: you have to set a manifest and open the file dialogs using WinAPI and not the WPF wrappers.

The full details: description of the problem, some clerifications, the manifest and finally calling the WinAPI open file dialog.

The last post contains classes that are mostly a drop-in replacement for the WPF file dialogs.

Update: I didn't notice the question was about how to do this on XP - it can't be done, all my posts are about matching the system style with WPF - you can't make system dialogs (that are part of the OS) from an older version magically upgrade to a newer look&feel that didn't exist when they were written.

I'm leaving this answer here in case someone gets here searching for a solution to the problem that caused me to write those blog posts - that system dialogs sometimes have an win2k or XP look on Vista and later.

Upvotes: 0

Felice Pollano
Felice Pollano

Reputation: 33272

since OpenFileDialog is a standard operating system dialog you can't modify its style. You can write your own file dialog, but is strongly discouraged because of potential loss of functionality.

Upvotes: 3

Related Questions