48

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.

gmuraleekrishna
  • 3,375
  • 1
  • 27
  • 45
Douglas Tosi
  • 2,310
  • 2
  • 18
  • 18

3 Answers3

96

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.

Tanerax
  • 5,826
  • 5
  • 29
  • 27
2

You could probably also use the ControlPaint class for this.

Mark Cidade
  • 98,437
  • 31
  • 224
  • 236
0

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.

Christian Specht
  • 35,843
  • 15
  • 128
  • 182
Chris Hughes
  • 717
  • 5
  • 2
  • 2
    Excellent. Purchase a third-party library for a fundamental button. How many billions of dollars and thousands of developers would it take before Microsoft provides core functionality out of the box? – Rick O'Shea Mar 16 '17 at 20:02