c# - How do i loop and add the items to comboBox so it will start from 1 to 8? -


for (int xx = 0; xx < picount; xx++) {     combobox1.items.add(xx); } 

picount int. , value of 8. if i'm starting 0 see in combobox 01234567 want see 12345678

just change loop:

for (int xx = 1; xx <= picount; xx++) {     combobox1.items.add(xx); } 

notice how upper limit comparison changed form < <=.

you can keep loop , add 1 in body:

for (int xx = 0; xx < picount; xx++) {     combobox1.items.add(xx + 1); } 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -