Click here to Skip to main content
15,903,856 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a code like this

for(int i=0;i<count;i++)>
{

string k=item[i];
}


I want to add each value of 'k' to a labelcontrol..If I have 10 values for 'k' then I want to display in a Label control with 10 values..How can I do this?..
Posted
Updated 17-Oct-11 23:38pm
v4

 
Share this answer
 
Hi,

Try Something like this

C#
for(int i=0;i<count;i++)>
{
   Label lbl[i]= new  Label();

   string k=item[i];
    lbl[i].Text=k;
}
 
Share this answer
 
for(int i=0;i<count;i++)>
{
label1.Text +="&nbsp;"+ item[i];//label1 is the id of your label
}
 
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