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

How to make all textboxes be in a array?

I have many textboxes in my application,I feel very unconvenient when
dealing with many textboxes,if the VB.NET can manage them as a array like
what the VB6 do?

Anybody can help me?

Thanks and regards.

Woodpecker
Nov 20 '05 #1
2 1160
"woodpecker" <gz*******@163.com> schrieb
I have many textboxes in my application,I feel very unconvenient
when dealing with many textboxes,if the VB.NET can manage them as a
array like what the VB6 do?


Yes, we still have arrays:

dim MyTextboxes as textbox() = {txt1, txt2, txt3}

Now they are in an array. Of course, the code has to be executed after the
call to InitializeComponent. Control arrays like in VB6 are not required
anymore.

Alternative syntax:

dim MyTextboxes as textbox()
'...later
MyTextboxes = New textbox(){txt1, txt2, txt3}
--
Armin

Nov 20 '05 #2
* "woodpecker" <gz*******@163.com> scripsit:
I have many textboxes in my application,I feel very unconvenient when
dealing with many textboxes,if the VB.NET can manage them as a array like
what the VB6 do?


Creating Control Arrays in Visual Basic .NET and Visual C# .NET
<http://msdn.microsoft.com/library/?url=/library/en-us/dv_vstechart/html/vbtchCreatingControlArraysInVisualBasicNETVisualCN ET.asp>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #3

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...
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...
5
by: garak | last post by:
Hi, can anyone tell me what ist wrong with this code ? TextBox txtField = new TextBox; txtField.Text = "Hello"; I get the error : An unhandled exception of type...
4
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...
3
by: samneefs | last post by:
I'm wondering if there's a way to create an array of textboxes, or loop through textboxes. The textboxes are in an ASP.NET page, but the looping happens through Visual Basic. On page load,...
3
by: Jacob.Bruxer | last post by:
Hi, I want to be able to append text using a For loop to each textbox in an array of textboxes that I've created, called tBoxes(). Basically I want to add a number of spaces to each textbox in...
2
by: james | last post by:
I recieve a business object and need to create a form to edit each property. This object is huge (like over 100 properties), and I dont want to make 100 label/textboxes by hand. Does anyone know...
0
by: begin22 | last post by:
Hey, I am using the MultiView control to create a Wizard style web app. At some point in the Wizard I need the user to input 2 values which correspond to rows and columns. On the next step in...
0
by: gurmeet07 | last post by:
if i have smthing like............. if (ht.ContainsKey(textBox7.Text)) { object array = (object)ht; textBox1.Text = (string)array; textBox2.Text = (string)array; textBox3Text = (string)array;...
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
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...
0
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
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.