Help copying selected lines from a multiline textbox.

M

Mike

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)
 
P

Peter

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

Mike

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top