Help TextBox Arra

supra80

Newcomer
Joined
Oct 5, 2004
Messages
7
Hi

I am dazed on this problem. Im teaching myself vb.net and so far I think its much better then VB6, My problem is I have a form which has 16 textboxes that i have created dynamically when a form loads. However these textboxes are in a line and i would like to have 2 columns consisting of 8 rows is this possible? Also once a user enters values in these textboxes how can I find the value. I have searched everywhere for this information to no avail.

I look forard to a response, thank you
 
coldfusion244 said:
I made a small demo program for you to check out :D
Hopefully you find it educational... Sorry about the bad VB coding standards.. I haven't done vb in a long time....


Thank You cold fusion I shall have a look. Is it ok toreply if i have question in regards to youre code?
 
Thats cool, actually its exactly what i was after however the text boxes will not be right next to each other they are seperated by label captions, i cant tell in your example where i can make the textsboxes further away from each other
 
supra80 said:
Thats cool, actually its exactly what i was after however the text boxes will not be right next to each other they are seperated by label captions, i cant tell in your example where i can make the textsboxes further away from each other

Yeah, i should have added comments :o

The property Location can take an input of type point. So where you see in the code it says new point(blah,blah) is where i am setting the x and y coordinates of the textbox. I set it right there in the if statement. You can also change the width and height of the textbox by use the property size. So for example if you had

textbox1
label1
textbox2

you could set the location property for texbox2 to show up right below label1 as follows...

Visual Basic:
textbox2.location = new point(0,textbox1.height + label1.height)

the 0 [first argument] is the X coordinate and the other [second argument] is the Y coordinate. All I did was add theirs heights together to find out how low on the form I had to put textbox2. The reason that I use their heights and widths is because if you resize the form, it allows for easy resizing of the controls [in your resize function] and you don't have to worry about placement.
 
coldfusion244 said:
Yeah, i should have added comments :o

The property Location can take an input of type point. So where you see in the code it says new point(blah,blah) is where i am setting the x and y coordinates of the textbox. I set it right there in the if statement. You can also change the width and height of the textbox by use the property size. So for example if you had

textbox1
label1
textbox2

you could set the location property for texbox2 to show up right below label1 as follows...

Visual Basic:
textbox2.location = new point(0,textbox1.height + label1.height)

the 0 [first argument] is the X coordinate and the other [second argument] is the Y coordinate. All I did was add theirs heights together to find out how low on the form I had to put textbox2. The reason that I use their heights and widths is because if you resize the form, it allows for easy resizing of the controls [in your resize function] and you don't have to worry about placement.

Thank you for that cold fusion it worked
 
Back
Top