position of a control in a table cell

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
 
E

Eliyahu Goldin

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
 
G

Guest

Thanks for your help

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

thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top