user3516240
user3516240

Reputation: 375

DevExpress Toggle Button - How To Check ON/OFF State? .net

Simple enough question, and that's why its been bothering me. I have a toggle button from DevExpress that I wish to use, but I cant seem to understand the syntax for checking to see if it's toggled on or off. I've checked their official stite and developer forums, but cant seem to find an asnwer to the most simple question. I basically want to do this:

Private Sub ToggleBackgroundMusic_Toggled(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToggleBackgroundMusic.Toggled

If ToggleBackgroundMusic.toggle = True then 
  'is toggled on
else 
  'is toggled off
end if 

 End Sub

But I've tried everything I can think of. Using the togglebuttons .properties control doesn't contain anything I could use, at least from what I've noticed... Any help?

Upvotes: 1

Views: 2893

Answers (1)

user2941651
user2941651

Reputation:

Please try the IsOn property (the docs you should find here):

Private Sub ToggleBackgroundMusic_Toggled(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToggleBackgroundMusic.Toggled

  If ToggleBackgroundMusic.IsOn = True then 
     'is toggled on
  else 
     'is toggled off
  end if 

End Sub

Upvotes: 2

Related Questions