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