D
Daan
I have downloaded the code from the article by Alex Yakhnin from
<http://www.opennetcf.org/permalink2.aspx?guid=d88b1a1a-a866-4247-
a0c8-94ab3c124f63>. This runs just fine, however, when I want to add
or remove items from the list, things go wrong.
Adding items only works if I code it like this:
custListBox.Items.Insert(0, listItem);
What I actually want is to clear the entire list, load new items into
it and have the control update / repaint / etc. itself. However, when
I try that using the following code, a ArgumentOutOfRangeException
occurs when the control is repaining itself (as if it tries to paint
the no-longer-existing items...)
custListBox.Items.Clear();
custListBox.Items.Add(newItem1);
custListBox.Items.Add(newItem2);
// custListBox.Refresh();
Any suggestions or alternative solutions to creating such a list?
Thanks,
Daan
<http://www.opennetcf.org/permalink2.aspx?guid=d88b1a1a-a866-4247-
a0c8-94ab3c124f63>. This runs just fine, however, when I want to add
or remove items from the list, things go wrong.
Adding items only works if I code it like this:
custListBox.Items.Insert(0, listItem);
What I actually want is to clear the entire list, load new items into
it and have the control update / repaint / etc. itself. However, when
I try that using the following code, a ArgumentOutOfRangeException
occurs when the control is repaining itself (as if it tries to paint
the no-longer-existing items...)
custListBox.Items.Clear();
custListBox.Items.Add(newItem1);
custListBox.Items.Add(newItem2);
// custListBox.Refresh();
Any suggestions or alternative solutions to creating such a list?
Thanks,
Daan