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:
Private Sub DisplayArray() ' we have the array and need to output it for editing For a = 0 To usrArray.GetLength(0) - 1 Dim page As New TabPage page.Name = "Tab" + a.ToString Dim tlp As New TableLayoutPanel Dim x(,) As String = usrArray(a, 2) For b = 0 To x.GetLength(0) - 1 Dim lblA As New Label Dim txtA As New TextBox lblA.Text = x(b, 0) + " is " + x(b, 1) + "=" lblA.Name = "lbl_" + a.ToString + "_" + b.ToString txtA.Text = x(b, 2) txtA.Name = "txt_" + a.ToString + "_" + b.ToString tlp.Controls.Add(lblA) tlp.Controls.Add(txtA) Next page.Controls.Add(tlp) TabControl1.TabPages.Add(page.Name, usrArray(a, 0).ToString + "=" + usrArray(a, 1).ToString) Next For a = 0 To usrArray.GetLength(0) - 1 Next End Sub




Reply With Quote