how to keep track of index in listbox items.

Answer Posted / ravikv

The following code retrieves the all the items of a list
box in to another list box in a single button click :

public void button1_click()
{
for(int i = 0; i < listbox1.items.count;i++)
{
listbox2.items.Add(listbox1.items[i].Text.Tostring());
}
}

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is ole used for?

498


How to bind the controls(best practice) comboboxes to the data in the dataset?

540


Give few examples of datareader that is used in different dataproviders.

539


What is execute scalar in ado.net?

498


What is bubbled event can you please explain?

525






How to check if the Dataset has records ?

530


How do you update a dataset in ado.net and how do you update database through dataset?

483


Why do we serialize data?

497


What are all the different authentication techniques used to connect to MS SQL Server?

544


What is the difference between Datareader and Dataset?

539


How to maintain the relation between two tables in ADO.NET?

540


how we can fire event in databound coulm in datagfrid withot using button?

567


What is the difference between ADO and ADO.Net?

589


Can we load multiple tables in a dataset?

540


What are the difference between readonly vs. Const?

502