p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   VB.NET 2002/2003 Basics (http://p2p.wrox.com/forumdisplay.php?f=76)
-   -   Change line in VB.net (http://p2p.wrox.com/showthread.php?t=8213)

Dinesh22 January 15th, 2004 10:44 PM

Change line in VB.net
Hello there,
                  i want to know if there is a command to change lines automatically on a multiline text box. This should be done from the source code.
I am trying to display each element of an array on a different line in a multiline text box.


planoie January 16th, 2004 07:58 AM

Do you want to CHANGE the line or just output an array into a multi-line textbox? If it's just a question of outputting the lines, then you just need to append a NewLine character after each array element.

Work smarter, not harder.

jlick January 16th, 2004 02:27 PM

Well, there are many ways you could change a line through code.

Since you have the data in an array, you could simple clear the textbox, and repopulate from the array. (See the previous post.)

If you need to do this in multiple places, you could create a class that inherits from the base array to hold your data. You add a property to the class that will take all the data in the array, and concatinates it to a string. Have the class use the databinding events to let the textbox know when a change occured, and bind the text box to the property. You could have the property let then have the logic step through the text and update the array (if the textbox is read/write).

I don't remember the data binding events off the top of my head, but they should be reasonable to find, and you are probably aware of them if you are doing data binding already.

John R Lick

All times are GMT -4. The time now is 04:50 AM.

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