position of a control in a table cell

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I created 2 label controls and add them to a table cell the first one is fine
left justified but i want to right justify the 2nd label control to the
right of the cell?
How to you programmically control where in the cell a control is placed?

here is my code to create the controls

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load

Dim lbl As Label
lbl = New Label
lbl.Font.Bold = True
lbl.ForeColor = System.Drawing.Color.FromArgb(3399)
lbl.Font.Name = "arial"
lbl.Font.Size = 12
lbl.Width = New Unit("40%")
MainTable.Rows(1).Cells(0).Controls.Add(lbl)

Dim lbl2 As Label
lbl2 = New Label
lbl2.Font.Bold = True
lbl2.ForeColor = System.Drawing.Color.FromArgb(3399)
lbl2.Font.Name = "arial"
lbl2.Font.Size = 12

thanks
 
I would create a table with one row and two cells, set align=left for the
first cell and align=right for the second one. Than you don't need labels in
the first place, you can just apply you formatting to the cell text.

Eliyahu
 
Thanks for your help

how would I enter the text in a cell programmically using VB.NET

thanks
 
Back
Top