tablelayoutpanel on run time cannot renew data

ayk

New member
Joined
Aug 22, 2007
Messages
1
Programming Experience
1-3
Hi, I am running periodic test for network machines but for now only on my machine for example: if directory c:\ayk exists and etc. every task has a label and textarea, label shows process name and textarea show what had done. an xml file holds tasks to do. and my program is reading the xml file once on runtime. everthing is ok for now. clearly working.

i want to create a tablelayout panel on runtime and have columns for each task.

i do this:

VB.NET:
    Private Sub StartTask(.....)
        Dim myTextBox As TextBox
        Dim myLabel As Label
        Dim mylayout As TableLayoutPanel
        mylayout = New TableLayoutPanel()
        mylayout.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.[Single]
        mylayout.ColumnCount = x '(it's static but it will be dynamic later)
        mylayout.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
        mylayout.Dock = System.Windows.Forms.DockStyle.Fill
        mylayout.Location = New System.Drawing.Point(0, 50)
        mylayout.Name = "TableLayoutPanel"
        mylayout.RowCount = 2
        mylayout.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 50.0!))
        mylayout.RowStyles.Add(New System.Windows.Forms.RowStyle)
        mylayout.Size = New System.Drawing.Size(1098, 823)
        mylayout.TabIndex = 0
        Me.Controls.Add(mylayout)

        myTextBox = Me.Controls(my.Attributes("Name").Value.ToString())
        myLabel = Me.Controls(my.Attributes("Name").Value.ToString() & "Label")

        If myTextBox Is Nothing Then
            myTextBox = New TextBox()
            myTextBox.Name = my.Attributes("Name").Value.ToString()
            myTextBox.Dock = System.Windows.Forms.DockStyle.Fill
            mylayout.Controls.Add(myTextBox, 0, 1)
            myLabel = New Label()
            AddHandler myLabel.DoubleClick, AddressOf Label_Click
            myLabel.Name = my.Attributes("ShortName").Value.ToString() & "Label"
            myLabel.Dock = System.Windows.Forms.DockStyle.Fill
            mylayout.Controls.Add(myLabel, 0, 0)
 ...
there problem starts here with layout, my program does its tasks only once when it's started then nothing comes.

thanks for looking, ayk.
 
2 lines of code to read an XML file and display it in tabular form:

myDataSet.ReadXml("C:\temp\whatever.xml")
myDataGridView.DataSource = myDataSet.Tables("TableName")
 
Back
Top