Reputation: 4399
I'm trying a sample application from the book Sams Teach Yourself WPF in 24 Hours. I have typed pretty much the same code as the one that I have downloaded from their website.
There's a part where it uses the OpenFileDialog
class. I'm developing in Windows 7, Visual Studio 2010 Ultimate. I think the system that the authors used was different.
Here are the snapshots of the OpenFileDialog
s on my computer:
The first one is the snapshot of OpenFileDialog
in my project, and the second one is of the downloaded project (again, they have almost exactly the same code).
I thought that it was because the downloaded version was compiled in another version of Windows, hence the difference. But it is the same, even when I compile it on my computer.
What causes the difference?
Edit: I've tried deleting the obj
and bin
folders in the solution directory, and rebuild the files. Still the windows are different.
Upvotes: 0
Views: 272
Reputation: 43330
The project is probably targetting a different framework
Right click on project > properties > application
Upvotes: 3
Reputation: 13022
You have two different OpenFileDialog
in different namespaces.
Microsoft.Win32.OpenFileDialog
System.Windows.Forms.OpenFileDialog
: WinForms dialog you can also use in your WPF projectsCheck which one your are using in your project.
Upvotes: 1