473,385 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Textbox

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
4 1456
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jonas L | last post by:
Hi, I need to create a textbox which acts as a normal textbox but with the following extra requirements: 1) In-focus color, when the textbox gets focus the backcolor property of the textbox...
4
by: Rodrigo DeJuana | last post by:
Howdy, I'm new to this .net stuff and really have little to no training. Im trying to create a new page for a web form, so i have been pretty much jsut coping code. I having some issue with...
0
by: Newasps | last post by:
Hi guys, I have a problem with UpdateCommand Event. In tihs event Ä°'m creating required controls to get that controls' values and also get them. But when I try to get updated values I'm getting the...
7
by: I am Sam | last post by:
I have a DataGrid that is passing information to a stored procedure properly but the parameters aren't being casted properly. I was woundering if anyone can tell me how I should properly cast the...
11
by: Keith | last post by:
I apologize for those of you who think I'm posting on the same topic. It is not that I don't appreciate all of your comments - and I'm definitely reading them all - but I think I have a differing...
2
by: Mamatha | last post by:
Hi I want to add an icon to the textbox's text. I don't know how to display icon in textbox in VB.NET. If any one knows please let me know. Thanks in advance. Mamatha
3
by: Brad Rogers | last post by:
All, Being immersed in vb.net and trying CSharp after almost a year I forgot the differences. I like vb fixing the uppercase/lowercase names and seeming to be more flexible to code entry. ...
0
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile...
8
by: Marco Pais | last post by:
Hi there. How can I change the background color of a textbox when it gets the focus? I can handle the "Enter" event and do this private void txtDummie_Enter(object sender, EventArgs e) { ...
1
by: Andy B | last post by:
I have this code: protected void EditEventsWizard_NextButtonClick(object sender, WizardNavigationEventArgs e) { //get the values from the DetailsView TextBox StartTime =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.