当前位置: 动力学知识库 > 问答 > 编程问答 >

.net - How to make window forms look More Beautiful

问题描述:

I have a Windows Forms application written in C#. I have to make my form's design more attractive (Windows 7 look). Are there are any third party tools to make forms look more beautiful?

网友答案:

If you're trying to theme the built-in controls with the Windows Aero user interface, you can find several drop-in control libraries online.

  • Windows Forms Aero
  • Aero.Controls
  • Microsoft's Windows API Code Pack for the .NET Framework
  • Fully themed Windows Vista Controls


Most of those libraries include support for the Desktop Window Manager functions, including adding the Aero Glass effect to your application. Daniel Moth explains this in greater detail in a series of articles on his blog:

  • Vista: Glass in C#
  • Glass in C#, an alternative approach
  • Vista glass answers and DwmEnableBlurBehindWindow

Of course, you can quickly get in over your head. In particular, the standard controls do not render correctly over glass because the color black is rendered as transparent. Anything that displays black
text will look washed out and be unreadable. The right way to draw text and images on the extended glass area is described here: Drawing smooth text and pictures on the extended glass area.

You'll also have to remember that these features are only available on Windows Vista and later versions. If your application needs to run under Windows XP (which it probably does), you're going to have to make sure that your application falls back gracefully and that you UI looks good there, too.

If you need more information on Aero Glass effects, search Stack Overflow. Myself and many others have posted lots of answers to related questions. For example, this one, and this one, and this one.


In general, however, my suggestion is to use the glass effect sparingly and only when you really feel that it adds something to your application. Don't just throw in gratuitous eye candy because you can. The most important thing is to focus on the usability of your application, from the perspective of its typical user. There is no reason to add additional complexity that doesn't provide any real usability benefits.

网友答案:

Try using Application.EnableVisualStyles(). Make sure to call it before Application.Run().

Application.EnableVisualStyles();
Application.Run(new Form());
网友答案:

For Vista Aero glass effect, see this for a starting point: Windows Vista Aero Pt. 1 - Adding Glass to a Windows Forms Application

分享给朋友:
您可能感兴趣的文章:
随机阅读: