Welcome to MSDN Blogs Sign in | Join | Help

Donkblog

Adventures into the world of amateurgramming. I'll leave the programming to the professionals.
Wow, That's Pretty and Easy - AutoUpgradeEnabled for Open File Dialog

When you use the OpenFileDialog to allow your users to select files there are actually different styles the window might look like.  When using .NET and running on Vista you can see there is quite a difference.  The picture on the left is a dialog with the new style and the the picture on the right is a dialog that look more like the Windows XP dialog. 

WithStyleWithOutStyle

 

 

 

 

 

 

 

AutoUpgradeEnabled lets you control how it will look.  When it is set to true you will see the new Vista style(when on Vista) and that is the default.  Its also important to note that this property doesn't show up till a later version of .NET, so if you use it on a machine that doesn't at least have .NET 2.0 SP1 you will get a MissingMethodException.

 

BONUS POINTS:

This isn't the first time, and I doubt it will be the last, that a concept like this has been used in Windows.  The BROWSEINFO structure used to open the folder browse dialog contains a flag, BIF_USENEWUI, that shows some historical reference to this pattern.

Posted: Thursday, March 13, 2008 7:18 AM by Brandon Turner

Comments

DanielMoth said:

Yes, and there is more to the additions in SP1 ;)

To discover it all, fyi, I have a link to a screencast on my blog that shows the full story.

# April 14, 2008 5:05 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker