vb.net - Have an IF statement constantly check -


is there anyway have if statement checking? i'm working list , need check if list count exceeds variable. i've since noticed easiest way make program run smoothly have if statement checking while program running.

the best approach change 'list' 'bindinglist'. event enabled list fire events when list changes:

private withevents mlist new system.componentmodel.bindinglist(of string)  public sub main()     mlist.add("an item") end sub  private sub mlist_addingnew(sender object, e system.componentmodel.addingneweventargs) handles mlist.addingnew     if mlist.count > 100         messagebox.show("threshold exceeded")     end if end sub 

alernatively start thread / timer polls this, you'll have watch out synchronization issues.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -