Solved

vbNewLine Problem

Posted on 2003-10-21
5
995 Views
Last Modified: 2012-08-14
vbNewLine is acting weird on my PC.  When I run this (or anything similar):

Private Sub Command1_Click()
   Text1.Text = "vbNewLine" & vbNewLine & "After new line"
End Sub

I get vbNewLine||After new line
Note:the || isn't exactly what apears, just as close as I can type it.

When I pasted that line into this form it acted like it was suposed to:
vbNewLine
After new line

I'm running XP Pro with visual studio enterprise.  I've tried reinstalling VB.  Any ideas?  Has anyone seen this before?

Thanks,
Mike
0
Comment
Question by:myname17
5 Comments
 
LVL 2

Expert Comment

by:Djinn_ro
ID: 9593926
Use vbCrLf
0
 
LVL 7

Accepted Solution

by:
Z_Beeblebrox earned 125 total points
ID: 9594160
You need to make the text box a multiline text box, it is one of the properties.

Zaphod.
0
 
LVL 10

Expert Comment

by:cool12399
ID: 9594581
also, make sure you enable the scrollable property (vertical scrollbars).
0
 
LVL 10

Expert Comment

by:cool12399
ID: 9594692
i.e.,

to do it programmatically:

text1.multiline=true
text1.scrollbars=1;
text1.text = "hi there" & vbCrLf & vbCrLf & "blahblahblah"

now it will work fine...!
0
 
LVL 4

Expert Comment

by:eric0213
ID: 9594746
The multiline property is readonly at run time... except through maybe some APIs (but I don't know of any).  You need to do it at design time
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now