Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
for(i=0;i<=26;i++)
{
array[i]= ///...listbox item to be selected according the value of i..
}

plz give me code ..

[Edit]Code block added[/Edit]
Posted
Updated 23-Feb-13 0:45am
v2

Hi,

Try this:
C#
for(i=0;i<=26;i++)
{
array[i] = listbox1.Items.Item[i]; // change listbox1 into the name of your list box
}

Hope this helps.
 
Share this answer
 
C#
for(i=0;i<=26;i++)
{
array[i]= itemsListBox.Items[i].ToString(); //(considering array is integer array )
}
 
Share this answer
 
v2
C#
for (int i = 0; i < itemsCount; i++)
    items[i] = itemsListBox.Items[i].ToString();
 
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