473,378 Members | 1,078 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,378 software developers and data experts.

array of textboxes

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
Nov 21 '05 #1
3 25796
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

Nov 21 '05 #2
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" <Jo**@discussions.microsoft.com>
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

Nov 21 '05 #3
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" <Jo**@discussions.microsoft.com> wrote in message
news:8E**********************************@microsof t.com...
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

Nov 21 '05 #4

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

Similar topics

4
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...
6
by: Bhavin | last post by:
Anybody quickly replies it, would be a great help! I try to create dynamic array of textboxes control in ASP.NET(C#). I got the following error while I tried to assign value to ID property of...
4
by: Kevin H | last post by:
Apologies in advance if this sounds slow-witted, but I didn't find it here. Need to populate some textboxes on a form. While I could hard code it (the number of options aren't that high), it...
2
by: RBohannon | last post by:
Is it possible to create a control array on an unbound form? I would like to be able to loop through a series of unbound text boxes. Thanks.
1
by: Stephen | last post by:
Was wondering if someone could please help me with an array I'd like to create in an asp.net page. I have to design an array which stores the values of addresses manually entered into textboxes...
3
by: barbara | last post by:
Hi all, I need to use hundreds of textboxes to display data. In VB 6.0, I can assign the value by the loop with a textboxes array. How to do it in VB.net? Thanks a lot.
6
by: Rich | last post by:
Hello, I have an application that contains several checkboxes. I originally created this app in VB.Net 2003 and upgraded the app to VB.Net 2005. I understand the vb2005 supports control...
9
by: jan82 | last post by:
Hi everybody I declared a private static array of textboxes at the top of a class, then i generate the array elements (new textbox()) in a separate function (private void in the same class), ...
1
by: bethmiddy | last post by:
Hello, I am very new to programming and am currently taking a class on VB. This is probably very simple, I just don't get it. I am working on a group project where we need to have 3 columns and...
7
by: Angel López | last post by:
How to do this with Vb.net 2008??? myNumber=1+ Int(Rnd()*90) text(myNumber).backcolor=vbRed Tanks Angel
1
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.