Douglas Tosi
Douglas Tosi

Reputation: 2350

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.

Upvotes: 50

Views: 35601

Answers (3)

Chris Hughes
Chris Hughes

Reputation: 757

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.

Upvotes: 0

Mark Cidade
Mark Cidade

Reputation: 99957

You could probably also use the ControlPaint class for this.

Upvotes: 2

Tanerax
Tanerax

Reputation: 5866

One method you can used to obtain this option is by placing a "CheckBox" object and changing its "Appearance" from "Normal" to "Button" this will give you the same functionality that I believe you are looking for.

Upvotes: 98

Related Questions