المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Selection in ListBox



C# Programming
01-22-2010, 09:50 AM
Hi,
I have listbox and im retriving text in listbox by selection.

When i selected item, the SeletionChanged function get invoked twice.

private void listBox1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
string str = (String)listBox1.SelectedItem;
listBox1.SelectedIndex =-1;

}
When i set breakpoint in bolded line first time it shows "",then when i press F5 it again comes to that place and shows the correct Text.
I want to get the text in first execution itself.

Anu