moving objects while running

plugged

Member
Joined
Sep 13, 2005
Messages
11
Programming Experience
3-5
guy how can i position textboxes in the vb code. i'm use to the textbox.top and .left properties but their not there in the web form properties. I need to position them in the code because they are created by the code during the running of the programme so i can't position them in the design view.


cheers
plugged
 
you have kinda got it, thats what i have done for far. i did it like this

Class result

Public lblName As Label

Public lblPos As Label

Public lblDate As Label

Public lblDay As Label

Public lbltxtName As Label

Public lbltxtPos As Label

Public lbltxtDate As Label

Public lbltxtDay As Label

Public Name AsString

Public Pos AsString

Public Dates AsDate

Public Day AsString

EndClass


Function setuprows(ByVal number)

Dim rows(number) As result

Dim x

For x = 0 To (number - 1)

rows(x).lblName.Text = "Name"

rows(x).lblPos.Text = "Position"

rows(x).lblDate.Text = "Date"

rows(x).lblDay.Text = "Day"

Next x

EndFunction


my problem is then i need to position them but i can't find a property to do it with. it should look something like this


For x = 0 To (number - 1)
rows(x).lblName.top = 50

rows(x).lblName.left = 50

rows(x).lblDate.top = 50

rows(x).lblDate.left = 150

Next x

but i can't find top or left or any property to change the location

can any one help

cheers
Plugged
 
This is how you add and adjust location of new control
VB.NET:
[size=2][color=#0000ff]Dim[/color][/size][size=2] myTxt [/size][size=2][color=#0000ff]As [/color][/size][size=2][color=#0000ff]New[/color][/size][size=2] TextBox
 
[/size][size=2][color=#0000ff]With[/color][/size][size=2] myTxt
 
.Location = [/size][size=2][color=#0000ff]New[/color][/size][size=2] Point(10, 10)
 
.Text = "Sample adding control"
 
[/size][size=2][color=#0000ff]End [/color][/size][size=2][color=#0000ff]With
 
[/color][/size][size=2]Controls.Add(myTxt)

Regards ;)
[/size]
 
that my problem theres no location property

rows(x).lblName.location = New Point(40, 50)

this has a blue squiggle under the location as does your example.

do i have to include or inherit an extra class or something to get the location property. The location property is there in windows apps but not on web forms.

cheers
Plugged
 
OMG ... i haven't noted that this is a q from within asp.net forum. Sorry!

Ok, this is how you can adjust position of certain textBox and Label

VB.NET:
<asp:TextBox id=txtTo style="Z-INDEX: 102; LEFT: 176px; POSITION: absolute; TOP: 72px" runat="server" Width="360px"></asp:TextBox>
<asp:Label id=lblSubject style="Z-INDEX: 103; LEFT: 32px; POSITION: absolute; TOP: 72px" runat="server" Width="136px" Font-Bold="True">Some text:</asp:Label>

Regards ;)
 
sorry i am away from my vb computer so i can't test, but that code you give me that can be placed straight in the .axsp.vb file right. I noticed that kind of code in the HTML side of the form designer, so i hope your not pointing to that because the code i need needs to be able to run from the vb side while the program is running. sorry this thread has dragged on.

cheers
Plugged
 
Back
Top