Hi all,

I have hit a brick wall with my latest project.

In essence the entire tab control is created on the fly, i have successfully added any number of tabs with the tabpage title being filled correctly. my problem however is when i add the content itself to the correct page, i have no item displayed on any tabs and however i can retrieve the contents and change them with code.

My code takes a pricelist xml file from my works website and my code is supposed to allow this content to be edited and returned to the server with adjusted prices to reflect updates in our costing. All the code works except the part to display the data, and consequently the code to use this data to update the array used for the xml while the program is running is not written.

Here is the display code which does not work:-
vb.Net Code:
  1. Private Sub DisplayArray()
  2.         ' we have the array and need to output it for editing
  3.         For a = 0 To usrArray.GetLength(0) - 1
  4.             Dim page As New TabPage
  5.             page.Name = "Tab" + a.ToString
  6.             Dim tlp As New TableLayoutPanel
  7.             Dim x(,) As String = usrArray(a, 2)
  8.             For b = 0 To x.GetLength(0) - 1
  9.                 Dim lblA As New Label
  10.                 Dim txtA As New TextBox
  11.                 lblA.Text = x(b, 0) + " is " + x(b, 1) + "="
  12.                 lblA.Name = "lbl_" + a.ToString + "_" + b.ToString
  13.                 txtA.Text = x(b, 2)
  14.                 txtA.Name = "txt_" + a.ToString + "_" + b.ToString
  15.                 tlp.Controls.Add(lblA)
  16.                 tlp.Controls.Add(txtA)
  17.             Next
  18.             page.Controls.Add(tlp)
  19.             TabControl1.TabPages.Add(page.Name, usrArray(a, 0).ToString + "=" + usrArray(a, 1).ToString)
  20.         Next
  21.         For a = 0 To usrArray.GetLength(0) - 1
  22.  
  23.         Next
  24.     End Sub