views:

120

answers:

2

Hey all, i have been using VB.net 2008 for a few months and i have a question. I compiled my program and ran it in a VM running windows 7. However, the progress bar looks like it does in XP. It doesn't have that cool look to it like I've seen in many other programs running in windows 7.

I have downloaded the 3.5 .net framework with sp1 and also the sdk for windows 7 (1.4+ gb dvd) but i still see nothing.

Is there a check-box i am missing in VS 2008 to enable these types of features? Maybe some type of code i need to place in the program?

Thanks!

David

A: 

I think you're looking for System.Windows.Forms.Application.EnableVisualStyles :)

Billy ONeal
Doesn't seem to do anything? The progressbar still is a square with one color for the bar?
StealthRT
@StealthRT: I can't say I've ever had the problem you're describing. That was a link I found at my first gander through the documentation. Without seeing the code constructing/changing the progress bar I can only guess as to what the problem is.
Billy ONeal
A: 

The Windows API Code Pack can be used to get access to some Win 7 (and Vista) controls etc:
http://code.msdn.microsoft.com/WindowsAPICodePack

You can also use the SetWindowTheme API function to make the standard controls look more 7ish.

Here's a link to a project that uses SetWindowTheme to get Vista style controls, should be similar for Windows 7 (quite possibly the exact same code sometimes):

http://www.codeproject.com/KB/vista/themedvistacontrols.aspx

ho1
How do you use those API's? I loaded it up in VS but what am i looking for in order to add to my own project?
StealthRT
The CodeProject project should show how to use `SetWindowTheme`, I've not actually used the `Windows API Code Pack`, but it wouldn't surprise me if they've got some good tutorials on that website.
ho1