.net - how to check if the listView is empty -


im creating windows form , have 2 problems

  1. i want enable button add item in listview otherwise disable if empty
  2. assuming have added item in listview. how can totalprice of item , put in label item added? thanks.

this code use compute total price of item in listview

    dim total integer = 0     each itemrow listviewitem in me.lvorder.items          total += convert.toint32(itemrow.subitems(2).text)      next 

sorry cant put image better understanding because need 10 reputation post image.

something simple should want:

btnxxx.enabled = (lvorder.items.count > 0) 

you need make sure doing in appropriate event(s). or when add or remove items


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -