简体   繁体   中英

How to make a button appear as if it is pressed?

Using VS2008, C#, .Net 2 and Winforms how can I make a regular Button look "pressed"? Imagine this button is an on/off switch. ToolStripButton has the Checked property, but the regular Button does not.

可以用来获取此选项的一种方法是放置一个“CheckBox”对象并将其“Appearance”从“Normal”更改为“Button”,这将为您提供我认为您正在寻找的相同功能。

您可能也可以使用ControlPaint类。

I think you may need a ToggleButton . You can take a look at third party vendors of WinForms components such as Telerik, DevExpress, ComponentFactory, ViBlend which provide such control. They all provide toggle buttons.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM