Here i am selecting the items from checkedListBox and saving them in ListBox by checking them and I am generating the textboxes according to the item count of list box.
Below is code:
Code
foreach (Object items in checkedListBox1.CheckedItems)Code
{Code
listBox1.Items.Add(items);Code
}Code
Code
int camCount = listBox1.Items.Count;Code
arrCam = new TextBox[camCount];Code
int dist = 0;Code
for (int i = 0; i < camCount; i++)Code
{Code
TextBox tx = new TextBox();Code
arrCam[i] = tx;Code
}Code
Code
foreach (TextBox fortx1 in arrCam)Code
{Code
fortx1.Location = new Point(448, 13 + dist);Code
groupBox8.Controls.Add(fortx1);Code
dist += 25;Code
}Code
VB.NET
here the problem is when i check all the items in checkedlistbox,items go to listbox and then generate the textboxes according to the listbox's item count.Till here it working fine,now when i uncheck any item from checkedlistbox the total no. of textboxes should also change but those textboxes are not getting redrawn only previously drawn textboxes remain in form. Can someone help me out where I am going wrong or where is the piece of code missing?
VulpesRank #55 · 29.2K reputationPosted Jan 13, 2015, 5:21 AM EST