By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,566 Members | 1,730 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,566 IT Pros & Developers. It's quick & easy.

Textbox

P: n/a
Hi,

I can't for the life of me remeber how to do this (mental block I guess).
But how do I put the text from textbox_1 at the top of textbox_2 also
retaining textbox_2's text
any help is appreciated.

Brian
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Cor
Hi Brian,

I think you can do that the best with the stringbuilder.

Something like (just typed here)
\\\
dim sb as new system.text.stringbuilder(textbox1.text)
sb.append(vbcrlf)
sb.append(textbox2.text)
textbox2.text=sb.tostring
////
(and I think is do it in those steps not in one time connected with a &)

The stringbuilder buildings strings real very much faster than the old
methods

I hope this helps?

Cor
Nov 20 '05 #2

P: n/a
Hi Cor,

Sorry if I'm being a damp squib here but a StringBiulder for a single
concat (or even a few small ones) gives no advantage. It comes into its own
when it reduces the number and/or size of temporary strings by a fairly decent
amount - such as within loops. The savings are due to reduced amounts of
copying and reduced GC activity.

Regards,
Fergus
Nov 20 '05 #3

P: n/a
Cor
Hi Fergus,

I did say something to Herfried it was I thought also, and then I did test
it and had to redraw my words.

This solution looks if it is to be used in a kind of loging system (and even
if it is not it could be).

The endstring has everytime to be past in a textbox at the end. Think on
some threads in this newsgroup.

So the string will be a little bit long. And every time x + x*n longer and
longer.

I have done some test with stringbuilder and it is in some cases I thought
minimal 100 times faster than all other approaches in even small string
tests.

Plus that I said yesterday to Jay B that I in future would only use
stringbuilder in my examples. So I did that in my first example that I had
of course.

And I believe it will make sence, did you thing that I had otherwise not
just concatenated that vbcrlf with a &.

And in this newsgroup you can never been a squib I think, this is good for
the discussion and if you don't believe you or me will make a testprogram.

Cor

Sorry if I'm being a damp squib here but a StringBiulder for a single
concat (or even a few small ones) gives no advantage. It comes into its own when it reduces the number and/or size of temporary strings by a fairly decent amount - such as within loops. The savings are due to reduced amounts of
copying and reduced GC activity.

Nov 20 '05 #4

P: n/a
Thanks Cor

Brian

"Cor" <no*@non.com> wrote in message
news:uD**************@tk2msftngp13.phx.gbl...
Hi Brian,

I think you can do that the best with the stringbuilder.

Something like (just typed here)
\\\
dim sb as new system.text.stringbuilder(textbox1.text)
sb.append(vbcrlf)
sb.append(textbox2.text)
textbox2.text=sb.tostring
////
(and I think is do it in those steps not in one time connected with a &)

The stringbuilder buildings strings real very much faster than the old
methods

I hope this helps?

Cor

Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.