Click here to Skip to main content
15,889,556 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
in list box 1 selected item goes to list box 2 then immediately list box 1 selected item is enabled how can i do.



i have two list box in my project. i have two buttons as follows add and load.

when i click the load button all faculty code is retrieved from the DB and displayed in the list box 1 that is working fine.



when i select, the list box 1 selected item and click the add button that selected faculty code goes to list box 2 that is working .

what i required is list box 1 selected item goes to list box 2 when i click the add button then immediately the selected list box 1 item is to be enabled false.

how can i do.help me.
Posted
Comments
Sandeep Mewara 22-Jan-13 8:54am    
And what have you tried so far? Where are you stuck?

1 solution

If you just want to deselect it:

C#
listBox1.SelectedIndex=-1;


If you also want to delete that:

listBox1.Items.Remove(listBox1.SelectedItem);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900