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

How do i output an array to a Textbox?

2
Let my apologize upfront, i'm very new to C#. I have an array i want to iterate and output it to a textbox. Is a textbox the ideal control for the output of my array? If yes, any suggestion would be helpful.
Jun 24 '09 #1
3 8938
tlhintoq
3,525 Expert 2GB
A listbox might be better.
A listbox has a property called 'items'. Each item becomes it's own 'line' if you will. It can be clicked on seperatly etc.

Expand|Select|Wrap|Line Numbers
  1. String[] YogiArray = {"Picnic", "Basket", "Ranger", "Smith"}
  2. foreach (string Booboo in YogiArray)
  3. {
  4.     MyListBox.Items.Add(Booboo);
  5. }
  6.  
Jun 24 '09 #2
Wixxel
2
Thank you. I appreciate all your help.
Jun 24 '09 #3
r035198x
13,262 8TB
And later if you use lists instead of arrays you should be able to bind your list 'directly' to the control.
Jun 24 '09 #4

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

Similar topics

6
by: Karen | last post by:
I'm having trouble getting input from a textbox in Visual Basic 6.0 Private Sub cmdGetNumber_Click() txtInput.Text = Str(Int(1000 * Rnd)) End Sub The error message states: "Method or data...
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...
1
by: GL | last post by:
I am trying to develop a prgram that randomly selects numbers for an addition program, then when the check answer button is pressed it colors the answer text field either green or red depending if...
4
by: Rich | last post by:
Hello, I have 3 textboxes and 1 combobox on a form. On entering the control I want to select all the text. I can make an array of textboxes like this: Dim arrTxt As TextBox() = {txt1, txt2,...
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), ...
2
by: gmb | last post by:
(.NET 2.0) code: array<TextBox^^dialog_txb = {gcnew TextBox(),gcnew TextBox(),gcnew TextBox(),gcnew TextBox(),gcnew TextBox()}; question: Is there a shorter way to declare and initialize an...
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...
1
by: Nightfarer | last post by:
Hello. I have a big trouble using System.Array class (it's the first time I use it) for a software I'm developing. I have a form with a textbox(numbers) and one button (done). Once the number...
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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
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...
0
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,...

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.