Hi,
I create two textboxes and two labels.
My problem is that: i want to get them under each other instead of beside
each other.
My second problem is that i want to have more spaces between the label and
the textbox.
Is there a way to do that?
Thanks
Cas
Dim b As New Label
b.Text = "label" & Space(7) 'space doesn't work
form1.Controls.Add(b)
Dim a = New TextBox
form1.Controls.Add(a)
Dim bb As New Label
bb.Text = "label" & Space(7)
form1.Controls.Add(bb)
Dim aa = New TextBox
form1.Controls.Add(aa) 9 2514
"Cas" <ca*@qscq.opwrote in message
news:eq**************@TK2MSFTNGP05.phx.gbl...
Hi,
I create two textboxes and two labels.
My problem is that: i want to get them under each other instead of beside
each other.
My second problem is that i want to have more spaces between the label and
the textbox.
Is there a way to do that?
Thanks
Cas
Dim b As New Label
b.Text = "label" & Space(7) 'space doesn't work
form1.Controls.Add(b)
Dim a = New TextBox
form1.Controls.Add(a)
Dim bb As New Label
bb.Text = "label" & Space(7)
form1.Controls.Add(bb)
Dim aa = New TextBox
form1.Controls.Add(aa)
Is this for a windows app or for a web app?
Mythran
It's for using it with asp.net. I also don't know how to use the style
"position: absolute" and left="..px" ...
Thanks again
"Mythran" <ki********@hotmail.comschreef in bericht
news:et****************@TK2MSFTNGP02.phx.gbl...
>
"Cas" <ca*@qscq.opwrote in message
news:eq**************@TK2MSFTNGP05.phx.gbl...
>Hi,
I create two textboxes and two labels. My problem is that: i want to get them under each other instead of beside each other. My second problem is that i want to have more spaces between the label and the textbox. Is there a way to do that? Thanks Cas
Dim b As New Label b.Text = "label" & Space(7) 'space doesn't work form1.Controls.Add(b) Dim a = New TextBox form1.Controls.Add(a)
Dim bb As New Label bb.Text = "label" & Space(7) form1.Controls.Add(bb) Dim aa = New TextBox form1.Controls.Add(aa)
Is this for a windows app or for a web app?
Mythran
"Cas" <ca*@qscq.opwrote in message
news:uq**************@TK2MSFTNGP04.phx.gbl...
It's for using it with asp.net. I also don't know how to use the style
"position: absolute" and left="..px" ...
Thanks again
"Mythran" <ki********@hotmail.comschreef in bericht
news:et****************@TK2MSFTNGP02.phx.gbl...
>>
"Cas" <ca*@qscq.opwrote in message news:eq**************@TK2MSFTNGP05.phx.gbl...
>>Hi,
I create two textboxes and two labels. My problem is that: i want to get them under each other instead of beside each other. My second problem is that i want to have more spaces between the label and the textbox. Is there a way to do that? Thanks Cas
Dim b As New Label b.Text = "label" & Space(7) 'space doesn't work form1.Controls.Add(b) Dim a = New TextBox form1.Controls.Add(a)
Dim bb As New Label bb.Text = "label" & Space(7) form1.Controls.Add(bb) Dim aa = New TextBox form1.Controls.Add(aa) Is this for a windows app or for a web app?
Mythran
Personally, I would use absolute positioning...instead, while dynamically
adding the label controls, you need to add a LiteralControl in between the
textbox and the label #2. The LiteralControl would contain a "<br>" tag ..
HTH,
Mythran
My problrm is that i have to create a unknown number of texboxes, and labels
(the amount is fetched from a database), and i want them to be displayed
more or less correctly ....
"Mythran" <ki********@hotmail.comschreef in bericht
news:ua****************@TK2MSFTNGP03.phx.gbl...
>
"Cas" <ca*@qscq.opwrote in message
news:uq**************@TK2MSFTNGP04.phx.gbl...
>It's for using it with asp.net. I also don't know how to use the style "position: absolute" and left="..px" ... Thanks again
"Mythran" <ki********@hotmail.comschreef in bericht news:et****************@TK2MSFTNGP02.phx.gbl...
>>>
"Cas" <ca*@qscq.opwrote in message news:eq**************@TK2MSFTNGP05.phx.gbl... Hi,
I create two textboxes and two labels. My problem is that: i want to get them under each other instead of beside each other. My second problem is that i want to have more spaces between the label and the textbox. Is there a way to do that? Thanks Cas
Dim b As New Label b.Text = "label" & Space(7) 'space doesn't work form1.Controls.Add(b) Dim a = New TextBox form1.Controls.Add(a)
Dim bb As New Label bb.Text = "label" & Space(7) form1.Controls.Add(bb) Dim aa = New TextBox form1.Controls.Add(aa)
Is this for a windows app or for a web app?
Mythran
Personally, I would use absolute positioning...instead, while dynamically
adding the label controls, you need to add a LiteralControl in between the
textbox and the label #2. The LiteralControl would contain a "<br>" tag
..
HTH,
Mythran
"Mythran" <ki********@hotmail.comwrote in message
news:ua**************@TK2MSFTNGP03.phx.gbl...
>
"Cas" <ca*@qscq.opwrote in message
news:uq**************@TK2MSFTNGP04.phx.gbl...
>It's for using it with asp.net. I also don't know how to use the style "position: absolute" and left="..px" ... Thanks again
"Mythran" <ki********@hotmail.comschreef in bericht news:et****************@TK2MSFTNGP02.phx.gbl...
>>>
"Cas" <ca*@qscq.opwrote in message news:eq**************@TK2MSFTNGP05.phx.gbl... Hi,
I create two textboxes and two labels. My problem is that: i want to get them under each other instead of beside each other. My second problem is that i want to have more spaces between the label and the textbox. Is there a way to do that? Thanks Cas
Dim b As New Label b.Text = "label" & Space(7) 'space doesn't work form1.Controls.Add(b) Dim a = New TextBox form1.Controls.Add(a)
Dim bb As New Label bb.Text = "label" & Space(7) form1.Controls.Add(bb) Dim aa = New TextBox form1.Controls.Add(aa)
Is this for a windows app or for a web app?
Mythran
Personally, I would use absolute positioning...instead, while dynamically
adding the label controls, you need to add a LiteralControl in between the
textbox and the label #2. The LiteralControl would contain a "<br>" tag
..
HTH,
Mythran
That should read, "Personally, I would NOT use ..."
:P
Mythran
"André" <sv*@sdv.sdwrote in message
news:eN*************@TK2MSFTNGP03.phx.gbl...
My problrm is that i have to create a unknown number of texboxes, and
labels (the amount is fetched from a database), and i want them to be
displayed more or less correctly ....
How do you mean "more or less correctly..."? Do you want them displayed
top-down or left-right? Do you want something like:
Label : TextBox
Label : TextBox
??
If so, then the following should work:
Dim frm As HtmlForm = Me.FindControl("form1") ' gave the form an id
of 'form1'
Dim lbl As Label
Dim lit As LiteralControl
Dim txt As TextBox
' Create first control set.
lbl = New Label()
lbl.Text = "Label #1: "
frm.Controls.Add(lbl)
txt = New TextBox()
txt.ID = "txtBox1"
frm.Controls.Add(txt)
lit = New LiteralControl("<br>")
frm.Controls.Add(lit)
' Create second control set.
lbl = New Label()
lbl.Text = "Label #2: "
frm.Controls.Add(lbl)
txt = New TextBox()
txt.ID = "txtBox2"
frm.Controls.Add(txt)
lit = New LiteralControl("<br>")
frm.Controls.Add(lit)
HTH :)
Mythran
I would put the label and the field in a block container, i.e. a div
tag. I would set a class on the div tag so that I could use CSS to
format them.
Resulting HTML:
<div class="FormItem">
<label for="someId"></label>
<input type="text" id="someId" />
</div>
CSS:
..FormItem { margin: 3px 0; }
..FormItem label { float: left; width: 150px; }
..FormItem input { float: left; width: 150px; }
I don't think that the Label control creates a real label tag, though.
You would have to use an HtmlGenericControl for that, just as for the
div tag.
Cas wrote:
Hi,
I create two textboxes and two labels.
My problem is that: i want to get them under each other instead of beside
each other.
My second problem is that i want to have more spaces between the label and
the textbox.
Is there a way to do that?
Thanks
Cas
Dim b As New Label
b.Text = "label" & Space(7) 'space doesn't work
form1.Controls.Add(b)
Dim a = New TextBox
form1.Controls.Add(a)
Dim bb As New Label
bb.Text = "label" & Space(7)
form1.Controls.Add(bb)
Dim aa = New TextBox
form1.Controls.Add(aa)
Thanks
"Göran Andersson" <gu***@guffa.comschreef in bericht
news:uk****************@TK2MSFTNGP03.phx.gbl...
>I would put the label and the field in a block container, i.e. a div tag. I would set a class on the div tag so that I could use CSS to format them.
Resulting HTML:
<div class="FormItem">
<label for="someId"></label>
<input type="text" id="someId" />
</div>
CSS:
.FormItem { margin: 3px 0; }
.FormItem label { float: left; width: 150px; }
.FormItem input { float: left; width: 150px; }
I don't think that the Label control creates a real label tag, though. You
would have to use an HtmlGenericControl for that, just as for the div tag.
Cas wrote:
>Hi,
I create two textboxes and two labels. My problem is that: i want to get them under each other instead of beside each other. My second problem is that i want to have more spaces between the label and the textbox. Is there a way to do that? Thanks Cas
Dim b As New Label b.Text = "label" & Space(7) 'space doesn't work form1.Controls.Add(b) Dim a = New TextBox form1.Controls.Add(a)
Dim bb As New Label bb.Text = "label" & Space(7) form1.Controls.Add(bb) Dim aa = New TextBox form1.Controls.Add(aa)
Thanks
"Mythran" <ki********@hotmail.comschreef in bericht
news:uV****************@TK2MSFTNGP04.phx.gbl...
>
"André" <sv*@sdv.sdwrote in message
news:eN*************@TK2MSFTNGP03.phx.gbl...
>My problrm is that i have to create a unknown number of texboxes, and labels (the amount is fetched from a database), and i want them to be displayed more or less correctly ....
How do you mean "more or less correctly..."? Do you want them displayed
top-down or left-right? Do you want something like:
Label : TextBox
Label : TextBox
??
If so, then the following should work:
Dim frm As HtmlForm = Me.FindControl("form1") ' gave the form an id
of 'form1'
Dim lbl As Label
Dim lit As LiteralControl
Dim txt As TextBox
' Create first control set.
lbl = New Label()
lbl.Text = "Label #1: "
frm.Controls.Add(lbl)
txt = New TextBox()
txt.ID = "txtBox1"
frm.Controls.Add(txt)
lit = New LiteralControl("<br>")
frm.Controls.Add(lit)
' Create second control set.
lbl = New Label()
lbl.Text = "Label #2: "
frm.Controls.Add(lbl)
txt = New TextBox()
txt.ID = "txtBox2"
frm.Controls.Add(txt)
lit = New LiteralControl("<br>")
frm.Controls.Add(lit)
HTH :)
Mythran
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: T. Wintershoven |
last post by:
Hello,
I have a few textboxes placed on a SSTab control devided over 3 tabs
Is there a way to clear all textboxes in one time in stead of one by one.
Someone told me "Use for each item...
|
by: Mark |
last post by:
Hello,
I have a report in MS Access 2002 that has a list of textboxes in a
row down the page. All these textboxes get variable length data from
the Control Source Table of the report or from a...
|
by: Bill Schneider |
last post by:
I have rebuilt a govermental formular with a report by putting some 30
textboxes in the page header at the right places for printing. I want
to fill these textboxes with the data from a query,...
|
by: ian.davies52 |
last post by:
Is there anything I can do about the apparent limit on the number of
textboxes that have calculations as their control source on a form or
report in ms-access? I have a query that pulls together...
|
by: Jason M |
last post by:
Hi,
Im very new to c#, so forgive me if this is a really stupid question.
Im trying to create a form for entering purchase requests.
For each line item I have a quantity, a description unit cost...
|
by: BLACKDOG157 |
last post by:
I've made a form with a variable number of textboxes. The user fills
them
out, and then I need to pick up the values he has filled in. The number
of textboxes vary depending on a value that the...
|
by: clintonG |
last post by:
I have to get to this later tonight or tommorrow...and wonder...
There's two TextBoxes in a Wizard Step posing an either-or situtation. Only
one or the other TextBox may pass data. The...
|
by: cmrhema |
last post by:
This is reference to Vandana Sridhar's refreshing the form
http://www.thescripts.com/forum/thread619976.html
The code displayed below did work.
Dim Ctrl As Control
For Each Ctrl In...
|
by: =?Utf-8?B?Sm9lIFRob21wc29u?= |
last post by:
Hi,
I have a C# windows form application (.NET 2.0) that reads data over the
serial port and displays the data via textboxes. I get a message 50
times/second. I know I can't update the screen...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
| |