Wrox Programmer Forums
|
.NET Framework 1.x For discussing versions 1.0 and 1.1 of the Microsoft .NET Framework.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 1.x 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 February 1st, 2007, 03:35 PM
Authorized User
 
Join Date: Feb 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Newline in VB

What is the syntax for newline in VB
like in a label want to display 2 3 4 5 6
by using new line
2
3
4
5
6
 
Old February 1st, 2007, 03:37 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You can use vbCrLf (Carriage return/Line Feed) or vbNewLine (which is actually a string constant that contains vbCrLf)

================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
 
Old February 3rd, 2007, 12:12 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Those constants aren't part of .Net.

In .Net, use Environment.NewLine (a bit more verbose, unfortunately)

-Peter
 
Old February 4th, 2007, 11:16 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by planoie
 Those constants aren't part of .Net.
You can certainly use vbCrLf in VB.NET - at least in 1.1 - I haven't checked 2.0 but I assume it is the same.

Whether it is appropriate to use or not is a matter of personal preference.

Regardless, the main consideration is that using Environment.NewLine or vbCrLf to add a newline to the text of a label requires that you do this in code rather than being able to simply set the property at design time.


Woody Z
http://www.learntoprogramnow.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace newline characters thomasjacob XML 1 May 2nd, 2006 04:06 AM
Problem with Newline character d_sathish XSLT 3 November 25th, 2005 07:20 PM
Newline character problem gsudipta1 XML 0 March 16th, 2005 03:54 AM
PDF vs Environment.NewLine MER78 BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 November 17th, 2004 12:10 PM
Newline in notepad, HOW.....???? veskoula XSLT 3 October 29th, 2003 10:49 AM





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