Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
private void checkedListBox3_SelectedIndexChanged(object sender, EventArgs e)
{

int i = checkedListBox1.SelectedItems.Count;
for (i = 1; i >= 3; i++)
{
if (i == 1)
{

textBox1.Text = checkedListBox1.SelectedItems[0].ToString();
}
if (i == 2)
{


textBox2.Text = checkedListBox1.SelectedItems[1].ToString();
}
if (i == 3)
{
textBox3.Text = checkedListBox1.SelectedItems[1].ToString();
}

}


i tried through above code but its only work for 1st text box another two values selected in checked list box not display into textbox2 and 3 please help
Posted
Comments
syed shanu 27-Mar-14 2:21am    
Change this for (i = 1; i >= 3; i++)
this should be as for (i = 1; i <= 3; i++)
Why you use i >=3 i think it should be i<=3

1 solution

how can you declare this
C#
int i = checkedListBox1.SelectedItems.Count;
for (i = 1; i >= 3; i++)


Look at 'i'

choose different variable
 
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