PC Review


Reply
Thread Tools Rate Thread

array of textboxes

 
 
=?Utf-8?B?Sm9obg==?=
Guest
Posts: n/a
 
      25th Nov 2004
i have lists with 10 and more textboxes for example test1.text, test2.text
....i want as i could do in vb6 with just a copy-paste of the same textbox, to
have an array like test(1).text, test(2).text and to change the contents
with a loop like "for"...is there any simple way to solve it?
thank you in advance
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q2hyaXMgUG9kbW9yZQ==?=
Guest
Posts: n/a
 
      25th Nov 2004
John,

http://www.codeproject.com/vb/net/Control_Arrays.asp might point you in the
right direction.

Chris.

"John" wrote:

> i have lists with 10 and more textboxes for example test1.text, test2.text
> ...i want as i could do in vb6 with just a copy-paste of the same textbox, to
> have an array like test(1).text, test(2).text and to change the contents
> with a loop like "for"...is there any simple way to solve it?
> thank you in advance

 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      25th Nov 2004
John,

It is so easy when you know this, however before you know it hard to find.

Dim test As Textbox() = Textbpx() {Textbox1, Textobox2}

:-)

I hope this helps?

Cor

"John" <(E-Mail Removed)>

>i have lists with 10 and more textboxes for example test1.text, test2.text
> ...i want as i could do in vb6 with just a copy-paste of the same textbox,
> to
> have an array like test(1).text, test(2).text and to change the contents
> with a loop like "for"...is there any simple way to solve it?
> thank you in advance



 
Reply With Quote
 
Elysee
Guest
Posts: n/a
 
      25th Nov 2004
John. it easy.

Create either you textboxes in design time or in runtime.
let suppse test1,test2, test3....
assign a tag to each textbox.

in new sub of the form do this:

Dim arrText as new arraylist

add all textboxes and others objects you want into the the array list

arrText.add test1
arrText.add test2.


Now, to use in your application

dim t as textbox
For each Obj in arrText
if typeof(Obj) is TextBox then
t=ctype(Obj,textbox)
if t.tag="1" then
'dosomething
end if
end if
next


"John" <(E-Mail Removed)> wrote in message
news:8EB5B79F-3BF1-4813-9AE3-(E-Mail Removed)...
> i have lists with 10 and more textboxes for example test1.text,

test2.text
> ...i want as i could do in vb6 with just a copy-paste of the same textbox,

to
> have an array like test(1).text, test(2).text and to change the contents
> with a loop like "for"...is there any simple way to solve it?
> thank you in advance



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Array of TextBoxes Bruce F Microsoft Dot NET 2 29th Nov 2005 09:38 AM
array of textboxes samneefs@gmail.com Microsoft ASP .NET 3 5th Mar 2005 11:01 PM
array of textboxes =?Utf-8?B?Q2hyaXM=?= Microsoft ASP .NET 1 17th Oct 2004 10:03 PM
Textboxes as an array sue Microsoft Excel Discussion 2 11th Mar 2004 02:09 PM
Array of Textboxes garak Microsoft C# .NET 4 20th Feb 2004 06:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:39 PM.