-
March 15th, 2012, 05:51 PM
#1
How to add items to a specific index in a listbox
i want to fill the listbox so that when ive added everything the data is in order.
int index = 0;
if (priority < PriorityList.SelectedItem)
{
while (priority < PriorityList.SelectedItem)
{
index++;
}
PriorityList.Items.Add(priority);
}
else
PriorityList.Items.Add(priority);
the problem im having is keeping track of the index. if the item is smaller than the selected item the selected item moves onto the next index until it gets to a point
-
March 15th, 2012, 05:54 PM
#2
Re: How to add items to a specific index in a listbox
thing submitted before i was finished and i cant find the edit post button. but to continue ...until it gets to a point where either its at the end of the list making the current number to add the smallest or when it finds a number in the list that its the same or larger than so it will add it to that index. if a number thats the largest so far it will get added to the top
-
March 15th, 2012, 07:46 PM
#3
Re: How to add items to a specific index in a listbox
If you liked my post go ahead and give me an upvote so that my epee.... ahem, reputation will grow.
Yes; I have a blog too - http://the-angry-gorilla.com/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|