473,320 Members | 2,097 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,320 software developers and data experts.

simple 1d Array

How do i simply display the contents of my array in to a textbox on my GUI ??




Expand|Select|Wrap|Line Numbers
  1.  
  2.         Dim details As String() = {TextBox1.Text, TextBox2.Text}
  3.  
  4.         Dim list As New ArrayList()
  5.  
  6.  
  7.         For Each detail As String In details
  8.             list.Add(detail)
  9.         Next detail
  10.  
  11.  
cheers
Mar 26 '08 #1
6 1160
kenobewan
4,871 Expert 4TB
A simple way is to bind the array to the list. HTH.
Mar 26 '08 #2
SpecialKay
109 100+
my VB is old but,
could you not just:

For array.size
textbox.text += next array value

in psudocode
Mar 26 '08 #3
Plater
7,872 Expert 4TB
I am confused here:
Expand|Select|Wrap|Line Numbers
  1. 'Here you create a 1D String Array from the contents of two textboxes.
  2. Dim details As String() = {TextBox1.Text, TextBox2.Text}
  3.  
  4. 'Here you create a new ArrayList()
  5. Dim list As New ArrayList()
  6.  
  7. 'Here you loop through your 1D String Array, placing the values into an ArrayList
  8. For Each detail As String In details
  9.    list.Add(detail)
  10. Next detail
  11. 'but for what end?
  12.  
Could you not just do this:
Expand|Select|Wrap|Line Numbers
  1. Dim list As New ArrayList()
  2.  
  3. list.Add(TextBox1.Text)
  4. list.Add(TextBox2.Text)
  5.  
What textbox are you wanting to show these values in?
Mar 26 '08 #4
Could you not just do this:
Expand|Select|Wrap|Line Numbers
  1. Dim list As New ArrayList()
  2.  
  3. list.Add(TextBox1.Text)
  4. list.Add(TextBox2.Text)
  5.  
What textbox are you wanting to show these values in?[/quote]


Yes i have now changed it :) much simpler I now want to display the whole array list in TextBox3.text for example.

How do i display the contents of "list" in textbox3.text
Mar 26 '08 #5
Plater
7,872 Expert 4TB
Well how do you want to terminate from item from the next?

For example you could just do this:
Expand|Select|Wrap|Line Numbers
  1. textbox3.Text=textbox1.Text & textbox2.Text
  2.  
Or with a newline:
Expand|Select|Wrap|Line Numbers
  1. textbox3.Text=textbox1.Text & "\r\n" & textbox2.Text
  2.  

But you are probably going to want to loop through your array and add them to the textbox.


I think a basic tutorial on subject (google it and you will find it)
Mar 26 '08 #6

I think a basic tutorial on subject (google it and you will find it)
ok thanks alot, i will have a look around
Mar 26 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Preston Crawford | last post by:
I'm looking to quickly get a photo album online. Very simple, thumbnails, a few pages, maybe a description, but hopefully a small script that's easy to edit and work into my existing site. I know...
13
by: Noah Spitzer-Williams | last post by:
Hello guys, I would like to do something seemingly simple: find out if an element in an array that is passed to my function exists. I used to think I could just do: if (arr) ... However, if...
5
by: Rob Somers | last post by:
Hey all I am writing a program to keep track of expenses and so on - it is not a school project, I am learning C as a hobby - At any rate, I am new to structs and reading and writing to files,...
8
by: Ross A. Finlayson | last post by:
I'm trying to write some C code, but I want to use C++'s std::vector. Indeed, if the code is compiled as C++, I want the container to actually be std::vector, in this case of a collection of value...
27
by: karan.shashi | last post by:
Hey all, I was asked this question in an interview recently: Suppose you have the method signature bool MyPairSum(int array, int sum) the array has all unique values (no repeats), your...
18
by: Bob Cummings | last post by:
Not sure if this is the correct place or not. Anyhow in school we were taught that when trying to calculate the efficiency of an algorithm to focus on something called FLOPs or Floating Point...
4
by: Armand | last post by:
Hi Guys, I have a set of array that I would like to clear and empty out. Since I am using "Array" not "ArrayList", I have been struggling in finding the solution which is a simple prob for those...
24
by: Michael | last post by:
Hi, I am trying to pass a function an array of strings, but I am having trouble getting the indexing to index the strings rather than the individual characters of one of the strings. I have...
6
by: Ronald Raygun | last post by:
I want to be able to randomly select the following from an array: 1). An image 2). A piece of text (name of tge image) 3). A piece of text (description of the image) I want to be able to...
0
rnd me
by: rnd me | last post by:
Purpose: Allows you to create "presets" for text form inputs. "Lightweight and simple to setup, it adds a lot of convenience for ~1kb of code." Only one function, two parameters: First...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.