Wrox Programmer Forums
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 5th, 2008, 04:22 PM
Friend of Wrox
 
Join Date: Mar 2008
Posts: 133
Thanks: 15
Thanked 1 Time in 1 Post
Send a message via ICQ to iceman90289 Send a message via AIM to iceman90289
Default TextBox Help

in my instant messenger i have a text box
how do i make new lines in my multiline textbox? so the strings dont show up as:
You said: blablahSheSaid:blahblah!

i want:
You said: blah blah

She said: blah blah

how do i make this happen?

 
Old April 5th, 2008, 04:45 PM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Have you tried "\r\n" (i.e. Carriage Return/Line Feed)

/- Sam Judson : Wrox Technical Editor -/
 
Old April 5th, 2008, 04:58 PM
Friend of Wrox
 
Join Date: Mar 2008
Posts: 133
Thanks: 15
Thanked 1 Time in 1 Post
Send a message via ICQ to iceman90289 Send a message via AIM to iceman90289
Default

yeah i did that and i really thought it would work but the strings are still just being pushed together.

 
Old April 5th, 2008, 05:04 PM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Strange, because the following works fine for me:

Code:
textBox1.Text = "A\r\nB";
/- Sam Judson : Wrox Technical Editor -/
 
Old April 6th, 2008, 01:51 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
Default

I cannot replicate the issue either, are you using a custom TextBox control or anything?

Rob
The Developing Developer
Currently Working Towards: MCAD C#
My Blog: http://www.robzyc.spaces.live.com
<center>"Nothing can stop the man with the right mental attitude from achieving his goal;
nothing on earth can help the man with the wrong mental attitude".

Thomas Jefferson</center>
 
Old April 6th, 2008, 02:40 AM
Friend of Wrox
 
Join Date: Mar 2008
Posts: 133
Thanks: 15
Thanked 1 Time in 1 Post
Send a message via ICQ to iceman90289 Send a message via AIM to iceman90289
Default

weird, it works now, i guess \r was important... oops. lol now my next thing is i do not want my converation box to be editable. this will cause people to edit the conversation and i do not want that.

 
Old April 6th, 2008, 03:54 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
Default

Set the text box ReadOnly property to true.
I would really suggest you get yourself a book on Windows Forms programming, it will cover all of these fundamentals..

Rob
The Developing Developer
Currently Working Towards: MCAD C#
My Blog: http://www.robzyc.spaces.live.com
<center>"Nothing can stop the man with the right mental attitude from achieving his goal;
nothing on earth can help the man with the wrong mental attitude".

Thomas Jefferson</center>





Similar Threads
Thread Thread Starter Forum Replies Last Post
pointing cursor from one textbox to other textbox lakshmi_annayappa ASP.NET 1.0 and 1.1 Basics 2 August 2nd, 2007 03:41 PM
help " in textbox mkb C# 2005 1 October 15th, 2006 03:08 PM
Textbox deontae45 VB.NET 2002/2003 Basics 1 September 25th, 2006 11:26 AM
Masked TextBox & formatting TextBox melvik C# 1 September 22nd, 2003 11:01 AM





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