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
Post a Comment