如何在 Visual C# 中制作 Windows 95 样式的按钮? [英] How can I make Windows 95 style buttons in Visual C#?

查看:25
本文介绍了如何在 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.

带样式:

没有样式:

这篇关于如何在 Visual C# 中制作 Windows 95 样式的按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆