473,408 Members | 2,399 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

position of a control in a table cell

GV
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
--
GV
Jun 7 '06 #1
2 3507
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

"GV" <GV@discussions.microsoft.com> wrote in message
news:4C**********************************@microsof t.com...
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
--
GV

Jun 7 '06 #2
GV
Thanks for your help

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

thanks
--
GV
"Eliyahu Goldin" wrote:
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

"GV" <GV@discussions.microsoft.com> wrote in message
news:4C**********************************@microsof t.com...
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
--
GV


Jun 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ken Kast | last post by:
Here's my situation. I have a statically positioned table that has an image in a cell. I also have some layers, defined by absolute-positioned DIVs for some animation. Everything works until I...
14
by: Zenobia | last post by:
Hello folks, Is it possible to position an item within a <td> element? For instance see below. The table has multiple rows, one for each database record. Each row has 3 hrefs associated with it...
0
by: joeZ | last post by:
hi there! I'm just going crazy with this stuff I want to do I though was simple. I just want to locate an image (which is linkeable) below the bottom of a cell. I mean, if the cell is at...
2
by: ted | last post by:
Hi, Was wondering if it's possible to find the left position of a table cell if the cell is created dynamically. I have a table with a single cell. When a button is clicked, I'd like to add...
3
by: moondaddy | last post by:
I'm trying to create my first user control and its function is to replace the use of a frames page. I want to position it under the pages header menus and to the right of the pages contents menus....
0
by: RSB | last post by:
Hi Every one, i am trying to create a UserControl and i am passing a Array of strings to it. Now based on the Array elements i am creating the LinkButtons Dynamically. I am also passing a Event to...
8
by: Edward | last post by:
I used to do this all the time in HTML-table layouting. How do I do this in CSS? -------------------------------------------------- <table width="400px"> <tr> <td bgcolor="beige">one line of...
19
by: derelicten | last post by:
hello , I have an issue positionating some pics I want to anchor to an existing table cell but I cant just place regular position on the cell because the background is fixed height and the set of...
1
by: thomasv | last post by:
Hi, I want to convert the following XML (OpenOffice Calc file): <?xml version="1.0" encoding="UTF-8"?> <office:document-content ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.