Or this:
int index = listBox1.SelectedIndex;
if (index >= 0)
{
listBox1.Items.RemoveAt(index);
Reestablecer();
// you only need to change the selected index if it is > the new last item
int lastItem = listBox1.Items.Count - 1;
listBox1.SelectedIndex = Math.Min(lastItem, index);
}
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
I put the break points, and step into the code but still, not working. While I run it in the emulator, it adds the data to the mobile database, but after i stop the debugging and restart the application, the data is lost. Any other idea? :((