How to arrange cels in a table layout panel?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sdanda
    New Member
    • Oct 2007
    • 36

    How to arrange cels in a table layout panel?

    Hello everybody,

    i am working on vb.net windows applcations.
    I am able to programmaticall y add textboxes to my form as needed, but what I would like to be able to do is add my textboes in a particular order.I assume that a tableLayoutPane l has some form of row / column coordinate system for addressing each cell but I'm not having any luck in figuring it out.

    Does anyone have any ideas how I might go about this. Thank you for your help.
    The code i wrote for doing this is

    tp1.Controls.Cl ear()
    Dim i As Integer
    Dim j As Integer
    Dim k As Integer
    tp1.RowCount = tb1.Text
    tp1.ColumnCount = tb2.Text
    'dgv1.RowCount = tb1.Text
    'dgv1.ColumnCou nt = tb2.Text
    For i = 0 To tb1.Text - 1 Step 1
    For j = 0 To tb2.Text - 1 Step 1
    Dim tb As New TextBox
    tp1.Controls.Ad d(tb, j, i)
    Next
    Next

    Here tp1 means tablelayoutpane l..The rows and columns of this tp1 is taken from two textboxes.It works fine.. but the textboxes are not arranged in a proper way.
    _______________ __
  • vanc
    Recognized Expert New Member
    • Mar 2007
    • 211

    #2
    I think you have to do this manually. There is FlowPanel that allows you to add any control and it will be in order of adding. If it doesn't help, you have to set text box position before add it into form. All you have to do is recalculate its position before hand and add it in form. Cheers.

    Comment

    Working...