samedi 21 mars 2015

Continue Through An If Statement If False

I'm trying to create a simple ignore list option for my program. When a sub runs, I want it to not execute some code if a user is on the list and a checkbox is checked.


I have tried this:



If Not My.Settings.IgnoredNames.Contains(PartnerDisplayName) AndAlso chkIgnore.Checked = False) Then
'Do something...
End If


This works, except even when the check box is checked by itself the if statement doesn't continue. I don't have a clue how to rewrite it.


This will not work either and I don't really know why. The sub triggers on an certain API event, and exiting it like so still lets the real code go through.



If My.Settings.IgnoredNames.Contains(ParterDisplayName) And chkIgnore.Checked = True Then Exit Sub
'Do something...

Aucun commentaire:

Enregistrer un commentaire