private void MakePCList() { LB_PCBOX.BeginUpdate(); LB_PCBOX.Items.Clear(); if (Gen == 2) { for (int i = PartyBoxCount, j = 0, boxsize = (int)NUD_BoxSize.Value; i < m.Length; i++, j++) { if (j < boxsize) { LB_PCBOX.Items.Add(GetLBLabel(i)); } } } else { for (int i = PartyBoxCount; i < m.Length; i++) { LB_PCBOX.Items.Add(GetLBLabel(i)); } } LB_PCBOX.EndUpdate(); }
private void MakePCList() { LB_PCBOX.BeginUpdate(); int s = LB_PCBOX.SelectedIndex; LB_PCBOX.Items.Clear(); switch (Gen) { case 2: for (int i = 6, j = 0, boxsize = (int)NUD_BoxSize.Value; i < m.Length; i++, j++) { LB_PCBOX.Items.Add(j < boxsize ? $"{i}: {m[i].AuthorName}" : "x"); } break; case 3: for (int i = 6; i < m.Length; i++) { LB_PCBOX.Items.Add(m[i].IsEmpty != true ? $"{i}: {m[i].AuthorName}" : "x"); } break; case 4: case 5: for (int i = p.Count; i < m.Length; i++) { LB_PCBOX.Items.Add(m[i].IsEmpty != true ? $"{i}: {m[i].AuthorName}" : "x"); } break; } if (s != LB_PCBOX.SelectedIndex && s < LB_PCBOX.Items.Count) { LB_PCBOX.SelectedIndex = s; } LB_PCBOX.EndUpdate(); }