c# - ListView check for max chat limit tresspassing -
is there anyway can auto check character limit in listview, changing background color orange or other color item violating limit?
this goes in event of imported text; after importing, loops through items , checks if items violate limit. if do, should coral background color, it's not working.
for (int = 0; < numpntr; i++) { int charlim = encoding.utf8.getbytecount(listview1.items[i].subitems[1].text); if (charlim > bytecnt) { listview1.items[i].backcolor = color.coral; } }
change line:
int charlim = encoding.utf8.getbytecount(listview1.items[i].subitems[1].text);
to:
int charlim = encoding.utf8.getbytecount(listview1.items[i].text);
it's work me.
Comments
Post a Comment