473,788 Members | 2,810 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to combine 2 lists of textboxes

Hi all,

I have two lists of textboxes:

'Create list of all textboxes on error log data tab
el_textboxes = New List(Of Windows.Forms.T extBox)(New
Windows.Forms.T extBox() {addr_x100, addr_x101, _
addr_x102, addr_x103, addr_x104, addr_x105, addr_x106,
addr_x107, addr_x108, addr_x109, addr_x10A, _
addr_x10B, addr_x10C, addr_x10D, addr_x10E, addr_x10F})

'Create list of all textboxes on status data tab
sd_textboxes = New List(Of Windows.Forms.T extBox)(New
Windows.Forms.T extBox() {idr_x000, idr_x001, _
idr_x002, idr_x003, idr_x004, idr_x005, idr_x006, idr_x007,
idr_x008, idr_x009, idr_x00A, _
idr_x00B, idr_x00C, idr_x00D, idr_x00E, idr_x00F})
How do I combine these 2 lists into one list (e.g. "all_textboxes" )?
I tried the following:
all_textboxes = el_textboxes
all_textboxes.A ddRange(sd_text boxes)

but then when I go back and do some processing with el_textboxes, its
size seems to change. I'm guessing there's a better way of combining
the 2 lists?

Thanks in advance,
-weg

Sep 12 '07 #1
6 2200
<we***@drexel.e duschrieb
Hi all,

I have two lists of textboxes:

'Create list of all textboxes on error log data tab
el_textboxes = New List(Of Windows.Forms.T extBox)(New
Windows.Forms.T extBox() {addr_x100, addr_x101, _
addr_x102, addr_x103, addr_x104, addr_x105, addr_x106,
addr_x107, addr_x108, addr_x109, addr_x10A, _
addr_x10B, addr_x10C, addr_x10D, addr_x10E, addr_x10F})

'Create list of all textboxes on status data tab
sd_textboxes = New List(Of Windows.Forms.T extBox)(New
Windows.Forms.T extBox() {idr_x000, idr_x001, _
idr_x002, idr_x003, idr_x004, idr_x005, idr_x006, idr_x007,
idr_x008, idr_x009, idr_x00A, _
idr_x00B, idr_x00C, idr_x00D, idr_x00E, idr_x00F})
How do I combine these 2 lists into one list (e.g. "all_textboxes" )?
I tried the following:
all_textboxes = el_textboxes
all_textboxes.A ddRange(sd_text boxes)

but then when I go back and do some processing
What kind of processing?
with el_textboxes,
its size seems to change.
Who's size? all_textboxes'?
I'm guessing there's a better way of
combining the 2 lists?
Do you experience an unexpected behavior or do you look for another way to
copy the items of both Lists into one?
Armin

Sep 12 '07 #2
the line of code:
all_textboxes = el_textboxes
just gives you 2 references to the same list.
maybe something like:
dim all_textboxes as new List(of ....)
all_textboxes.a ddrange(el_text boxes)
all_textboxes.a ddrange(sd_text boxes)

--
Terry
"we***@drexel.e du" wrote:
Hi all,

I have two lists of textboxes:

'Create list of all textboxes on error log data tab
el_textboxes = New List(Of Windows.Forms.T extBox)(New
Windows.Forms.T extBox() {addr_x100, addr_x101, _
addr_x102, addr_x103, addr_x104, addr_x105, addr_x106,
addr_x107, addr_x108, addr_x109, addr_x10A, _
addr_x10B, addr_x10C, addr_x10D, addr_x10E, addr_x10F})

'Create list of all textboxes on status data tab
sd_textboxes = New List(Of Windows.Forms.T extBox)(New
Windows.Forms.T extBox() {idr_x000, idr_x001, _
idr_x002, idr_x003, idr_x004, idr_x005, idr_x006, idr_x007,
idr_x008, idr_x009, idr_x00A, _
idr_x00B, idr_x00C, idr_x00D, idr_x00E, idr_x00F})
How do I combine these 2 lists into one list (e.g. "all_textboxes" )?
I tried the following:
all_textboxes = el_textboxes
all_textboxes.A ddRange(sd_text boxes)

but then when I go back and do some processing with el_textboxes, its
size seems to change. I'm guessing there's a better way of combining
the 2 lists?

Thanks in advance,
-weg

Sep 12 '07 #3
What kind of processing?

For Each _textbox As Windows.Forms.T extBox In el_textboxes
'Processing...
array(i) = 10
i = i + 1
Next

array() is the same size as the number of elements in el_textboxes.
When commenting out the "all_textbo xes" lines from above, the For loop
executes without any errors. However, when uncommenting the
"all_textbo xes" lines from above, I get an index out of range error
for array(i).

Sep 12 '07 #4
<we***@drexel.e duschrieb
What kind of processing?

For Each _textbox As Windows.Forms.T extBox In el_textboxes
'Processing...
array(i) = 10
i = i + 1
Next

array() is the same size as the number of elements in el_textboxes.
When commenting out the "all_textbo xes" lines from above, the For
loop executes without any errors. However, when uncommenting the
"all_textbo xes" lines from above, I get an index out of range error
for array(i).
I was not sure about the problem, but Terry probably has the answer.
Armin
Sep 12 '07 #5
You may be seeing the list grow automatically to accomodate more than the
actual items it contains.

You can call List.TrimExcess to trim the unused slots in the list.

http://msdn2.microsoft.com/en-us/library/ms132207.aspx

--
Mike

Mike McIntyre [MVP]
http://www.getdotnetcode.com
<we***@drexel.e duwrote in message
news:11******** **************@ 50g2000hsm.goog legroups.com...
Hi all,

I have two lists of textboxes:

'Create list of all textboxes on error log data tab
el_textboxes = New List(Of Windows.Forms.T extBox)(New
Windows.Forms.T extBox() {addr_x100, addr_x101, _
addr_x102, addr_x103, addr_x104, addr_x105, addr_x106,
addr_x107, addr_x108, addr_x109, addr_x10A, _
addr_x10B, addr_x10C, addr_x10D, addr_x10E, addr_x10F})

'Create list of all textboxes on status data tab
sd_textboxes = New List(Of Windows.Forms.T extBox)(New
Windows.Forms.T extBox() {idr_x000, idr_x001, _
idr_x002, idr_x003, idr_x004, idr_x005, idr_x006, idr_x007,
idr_x008, idr_x009, idr_x00A, _
idr_x00B, idr_x00C, idr_x00D, idr_x00E, idr_x00F})
How do I combine these 2 lists into one list (e.g. "all_textboxes" )?
I tried the following:
all_textboxes = el_textboxes
all_textboxes.A ddRange(sd_text boxes)

but then when I go back and do some processing with el_textboxes, its
size seems to change. I'm guessing there's a better way of combining
the 2 lists?

Thanks in advance,
-weg

Sep 13 '07 #6
Like Armin I don't understand your problem.

However you can start stopping this kind of code and use a for index loop.
(Every array or collection has a count or length property)
For Each _textbox As Windows.Forms.T extBox In el_textboxes
'Processing...
array(i) = 10
i = i + 1
Next
Sep 13 '07 #7

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

Similar topics

7
16974
by: Blah Blah | last post by:
here's my problem - i run a web site with a java servlet backend (apache/tomcat/linux/mysql), and i want to add some php content to my jsp pages. why would i want to do something like this? i want to add some third party blogging software that's written in php. it would be easy to have two entirely different sets of pages - but i don't want a MacDLT solution. i'd like to be able to have blog content throughout the website. is there...
3
1867
by: Nickolay Kolev | last post by:
Hi all, Continuing the search for interesting challenges with lists, tuples and dictionaries I am looking for a way to do the following. one = { 'a' : 1, 'b' : 2, 'c' : 3 }
3
2723
by: Nick | last post by:
I am working a new application...well actually a series of applications for my company. They want internal users to be able to go to a site and everything regarding security is transparent, however we will have brokers and customers that also need to connect and will require a username and password. In this case we were going to store their credentials in a SQL database. Internal users will have the ability to access the same resources...
11
3147
by: ian.davies52 | last post by:
Is there anything I can do about the apparent limit on the number of textboxes that have calculations as their control source on a form or report in ms-access? I have a query that pulls together all the fields from two tables, each with about 20 fields. I then have a statistics form that has the query as its source and the form has 273 textboxes on, each with a calculation based on the underlying query values. The form looks like a...
1
5855
by: William Stacey [MVP] | last post by:
I need a bullet proof way to combine a root and a relative path to form a FQ rooted path (similar to a VDir in IIS). Path.Combine alone will not do the job in all cases. I also need to be sure the no funny business can go on in the passed "path" that would produce a path not in the root (i.e. "..\..\dir1"). Here is my first stab at it, but not sure if this is too much or not enouph to ensure this. Any thoughts are welcome. TIA. ///...
3
8211
by: Schroeder, AJ | last post by:
Hello group, I am a relative PHP newbie and I am trying to combine two arrays together, but I also need to keep the keys of one array intact. What I am doing is two SNMP walks against a Cisco router in which I expect the script to return the interface number along with a small description of the interface type, like this: Array (
14
15577
by: TIonLI | last post by:
I am working with a table that lists dates and corresponding times in separate fields. For purposes of building a query to calculate elapsed time I would like to combine a field with a field ending up with a new field ... Is it Possible?
0
975
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I have to lists, using C# and the look like List <stringreportname = new List<string>(); List <Int32 reportnumber = new List <Int32>(); They get filled with corresponding data, both lists are the same size. I need to create a third string lists and fourth integer list that combines the report names when the report numbers are the same. For example the data might look like reportname report number vehicles ...
30
4455
by: stefbek97 | last post by:
Hello Everyone, I am ready to pull my hair out with this situation. Here is what my application Looks like. I have a Master Page,Content Page with a Tab Container and A user Control inside the Tab Panel of the Container. In the user Cotrol I have a Table with Textboxes. My assignment is to Calculate the average of two textboxes and diplay in a Label. I need to do that on the client so that there is no postback so I try to use...
0
10364
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10172
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9967
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4069
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.