How to Prevent the Toggle Button from changing between Active and Inactive States
9 Dec 2019 / 1 minute to read
You have to subscribe to the ToggleStateChanging event and cancel the change. The following code example explains the same.
private void toggleButton1_ToggleStateChanging(object sender, CancelEventArgs e)
{
e.Cancel = true;
}
Private Sub ToggleButton1_ToggleStateChanging(sender As System.Object, e As System.ComponentModel.CancelEventArgs) Handles ToggleButton1.ToggleStateChanging
e.Cancel = True
End Sub
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