如何在 Visual C# 中制作 Windows 95 样式的按钮?

如何在 Visual C# 中制作 Windows 95 样式的按钮?

问题描述:

我正在编写一个程序,我只是想知道如何在 Windows 95 中放置看起来像的按钮:

I am writing a program and I am just curious of how to put buttons that look like in Windows 95:


(来源:aos.co.za)

我使用的是带有 Winforms 的 Visual C# Express 2010.

I am using Visual C# Express 2010 with Winforms.

这可以在我上面描述的编译器/IDE 中实现吗?

Is this possible in the compiler/IDE I described above?

通常您应该让用户做出选择.他们有能力这样做.

Normally you should let the user make that choice. They have the ability to do so.

但是,要回答这个问题,您需要禁用 XP 中引入的视觉样式功能.通过调用以下方法启用视觉样式:

But, to answer the question, you need to disable the visual styles feature that was introduced in XP. Visual styles are enabled with a call to:

Application.EnableVisualStyles();

通常作为 Main 方法的第一个动作.删除该调用,您的应用程序将不会被设置样式.

typically as the first act of your Main method. Remove that call, and your application will not be styled.

带样式:

没有样式: