Custom Styling in Windows Forms Toggle Button
9 Dec 2019 / 1 minute to read
The appearance of the Toggle Button is customized by using the IToggleButtonRenderer. This interface provides few methods to control painting borders, arrow, and so on.
To customize the appearance,
- Create a new custom renderer class and implement each of the members defined in IToggleButtonRenderer.
- Assign instance of your custom renderer to the Renderer property of ToggleButton. By default, ToggleButton is painted by using its default renderer.
CustomRenderer renderer = new CustomRenderer(); toggleButton1.Renderer = renderer;
Dim renderer As New CustomRenderer() toggleButton1.Renderer = renderer
Was this page helpful? Yes No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page