Is it possible to create a toggle button in C# WinForms? I know that you can use a CheckBox control and set it's Appearance property to "Button", but it doesn't look right. I want it to appear sunken, not flat, when pressed. Any thoughts?
A toggle button allows the user to change a setting between two states. You can add a basic toggle button to your layout with the ToggleButton object. Android 4.0 (API level 14) introduces another kind of toggle button called a switch that provides a slider control, which you can add with a Switch object.
Toggle refers to the act of switching from one view, setting, or function to another. It implies that there are only two possible options and that a user is switching between them, and usually these options are on or off for a specific preference.
You can just use a CheckBox
and set its appearance to Button
:
CheckBox checkBox = new System.Windows.Forms.CheckBox(); checkBox.Appearance = System.Windows.Forms.Appearance.Button;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With