Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 27th, 2005, 05:52 AM
Registered User
Join Date: Jul 2005
Location: Hobart, Tasmania, Australia.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default populating an array from text box

I'm day new to this funny clicky stuff and already in need of rescue.

I'm attempting to populate an array of strings(names) with the user typing each name into a textbox as a way of input. Each name entered on a separte line and so into the next array element. I've set the text box to multiline but at the moment it gather all the data I've entered( how ever many lines) and plonks it in the first array element.
I've had no trouble writing this exercise as a console application but the clicky stuffs got me stuck. May be I shouldn't be using the textbox control?? This must be so straight forward as I can't find an example in the books. Whats the best way to go about this??


Reply With Quote
  #2 (permalink)  
Old July 27th, 2005, 08:30 AM
Friend of Wrox
Join Date: Jun 2003
Location: , , .
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts

You will need to check for a carriage return in the text that is placed in your text box. When one is found, you know you are at a new line. Place that text into the next element.

You will also have to check for some additional things such as an empty string that could signify the end of the list or that a user just pressed enter twice. You also have the burden of checking every string for a carriage return. I probably wouldn't implement it this way.

I would have the user type in the text into a single line textbox and press enter for each item they have. You could then add these items to a listbox or if you still desire a textbox you could populate a read-only textbox. I would stick with the listbox.
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Populating a list box VBAbeginner Access VBA 1 April 8th, 2008 09:24 AM
Please : populating selection box kumar_siva HTML Code Clinic 2 December 29th, 2005 05:45 AM
Populating text box from RecordSet ersp Access VBA 5 April 4th, 2004 08:52 PM
Populating a text box from a RecordSet ersp Access 1 April 4th, 2004 04:22 PM
populating a box sporkman43 Classic ASP Basics 0 August 18th, 2003 02:04 PM

All times are GMT -4. The time now is 04:20 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.