c# - listview FindItemWithText empty or not? -


i'm searching listview item specified string. if string found select listviewitem.

listviewitem index = listview1.finditemwithtext(txtsearch.text); 

pretty simple :) i'm having hard time figure, want know index variable populated, thinking check length property cannot find, once again how know index variable empty or not?

thanks

finditemwithtext method returns null if list empty or there no matching item. so, check result null:

listviewitem item = listview1.finditemwithtext(txtsearch.text); if (item != null) {    // have match } 

Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -