471,066 Members | 1,258 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 software developers and data experts.

Help copying selected lines from a multiline textbox.


I am trying to write a little program for my own use using VB2005 express edition.
I have a list of peoples names in a file that I read into an array of strings. I am using a multiline textbox
to enter new, edit existing, and view the names in the array. This all works well, but now I want to be able
to select one more names from the list displayed in the multiline textbox then click a button to copy the
selected names into another list so that I can work with the names in the 2nd list. I don't want to have to
highlight all characters in a name to select it. It would be much better to be able to simply click on a name
and have the entire name selected then ctrl/click another to select a 2nd name or shift/click to select a
range of names. I've been fiiddling with textboxes and am begining to wonder if it's even possible to do this
with 2 multiline text boxes. I sure hope it can because entering the names is quick easy using the textbox.
I would really appreciate any ideas about this could be done.

Mike
"The scientist is possessed by the sense of universal
causation...His religious feeling takes the form of
rapturous amazement at the harmony of natural law,
which reveals the intelligence of such superiority
that, compared with it, systematic thinking and acting
of human beings is an utterly insignificant reflection."
Albert Einstein (theoretical physicist)
Apr 3 '07 #1
2 3225
I think what you're looking for is not the multiline textbox, but the
listbox control. Its Item property contains a collection of items that can
be selected, line by line, as you describe.

"Mike" <no********@comcast.netwrote in message
news:4e********************************@4ax.com...
>
I am trying to write a little program for my own use using VB2005 express
edition.
I have a list of peoples names in a file that I read into an array of
strings. I am using a multiline textbox
to enter new, edit existing, and view the names in the array. This all
works well, but now I want to be able
to select one more names from the list displayed in the multiline textbox
then click a button to copy the
selected names into another list so that I can work with the names in the
2nd list. I don't want to have to
highlight all characters in a name to select it. It would be much better
to be able to simply click on a name
and have the entire name selected then ctrl/click another to select a 2nd
name or shift/click to select a
range of names. I've been fiiddling with textboxes and am begining to
wonder if it's even possible to do this
with 2 multiline text boxes. I sure hope it can because entering the names
is quick easy using the textbox.
I would really appreciate any ideas about this could be done.
Apr 3 '07 #2
On Tue, 03 Apr 2007 21:38:15 GMT, "Peter" <st*****@hotmail.comwrote:
>I think what you're looking for is not the multiline textbox, but the
listbox control. Its Item property contains a collection of items that can
be selected, line by line, as you describe.
Thanks, that works great except I lost the ease of entering the names in the test box.
I just added a seperate textbox just for the purpose of initially building the list of names.
Thanks again.

Mike
"The scientist is possessed by the sense of universal
causation...His religious feeling takes the form of
rapturous amazement at the harmony of natural law,
which reveals the intelligence of such superiority
that, compared with it, systematic thinking and acting
of human beings is an utterly insignificant reflection."
Albert Einstein (theoretical physicist)
Apr 4 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Chuck Bowling | last post: by
1 post views Thread by Rahul | last post: by
1 post views Thread by Developer | last post: by
reply views Thread by Eric | last post: by
reply views Thread by Mike Collins | last post: by
5 posts views Thread by Ian Tedridge | last post: by
19 posts views Thread by Jeff | last post: by

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.