Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #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??


  #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.

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

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