I'm running windows vista and want to get the appearance to look like regular vista programs. Are there any really good tutorials/articles on how to build Vista Style apps? I would also like to learn how to use the native code and convert it to C# like in this example.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
If you're using WinForms it's relatively easy to accomplish it because WinForms is based on the native Win32 controls. Many controls have ways to enhance their rendering by setting additional flags (by sending messages to the native control) or using SetWindowTheme. This can be achieved through Interop.
As an example, take a simple ListView. If you want an explorer-style listview you use SetWindowTheme on the exposed handle of the ListView. We use interop to get access to the native SetWindowTheme() function, hook the window procedure of the ListView and apply the theme when the control is created:
The difference between a default ListView and our enhanced version: ListView difference http://img100.imageshack.us/img100/1027/62586064nt6.png
Unfortunately there isn't one simple way for every control. Some controls don't even have any WinForms wrapper. Recently I stumbled upon a nice compilation in this CodeProject article which is worth a look. There may also be managed libraries out there that package this.
If you want apps for Windows XP to just look 100% like Vista, then it's going to be very complex as you will need to override the way Windows are painted so you can design your own compatible version.
Usually these things are done one the Windows theme-level, sometimes by including special handlers that change the way all apps look.
Then there are tools like FastAero that add transparency to all Windows XP forms (source code available).
In any case, if you want your apps to look Vista-like, you need to respect the Windows User Experience Interaction Guidelines for Aero.
You can also use WPF to fake the Aero-style of controls so your apps will look similar on any version of Windows.
You could take a look at a third party solution.
We use DevExpress to achieve nicely styled WinForm apps on WinXP, specifically their WinForms ribbon controls
If you're using WPF you can use Microsoft's Vista Bridge library which has several useful controls. Otherwise, just look at the Windows UX Guidelines and roll your own. From that page:
Additionally, you can check out Aero.Controls and Aero.Wizard, two free open source WinForms packs I wrote that set you up with some standard controls and a wizard, respectively.