I have a panel control which may or may not load a user control consisiting of two text boxes in a side by side fashion. Once the form is loaded user may make a call to the same user control that will will add more text boxes to the same panel. The problem I have is after the form load when a user interaction make s a call to the user control it places it on the on the existing text box controls in the panel.
Following method is called from form_load
private void loadPanelFileCount_1()
{
for (int i = 0; i < recordsFileNameCount_1.Count; i++)
{
Book.UserControls.
uFileNameWithComments uc = new Book.UserControls.uFileNameWithComments();
uc.Location =
new Point(1, 10 + 22 * i);
uc.FileName = recordsFileNameCount_1
.ToString();
uc.FileNum = recordFileNumCount_1
.ToString();
uc.Comments = recordsFileComments_1
.ToString();
pnlChkinFiles.Controls.Add(uc);
}
}
pnlCtrlCounter = pnlChkinFiles.Controls.Count;
}
//end method loadPanelCheckoutFiles
Now after the form load is done, user may add more controls in the panel by double clicking on a listview. This method is called from a list view remove items.
private void loadPanelCheckinFiles()
{
UserComments =
new ArrayList();
uc.Location =
new Point(1, 10 + 22 * locCounter);
uc.FileName = file_name;
uc.FileNum = file_number.ToString();
//uc.UserName =listView1.SelectedItems[0].SubItems[2].Text;
uc.UserName = user_name;
// fileChkoutToName[0].ToString();
uc.Comments = file_comments;//uc.rchtxtComments.Text;
uc.TransFlag = transferFlag;
pnlChkinFiles.Controls.Add(uc);
locCounter=locCounter+1;
}
//end method loadPanelCheckoutFiles
But what is doing it placing the text boxes on already exisiting text boxes and visually the panel contains only one set of text box fields.
If anyone could help me out in resolving this issue, it will be greatly appreciated.