Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

vbNewLine Problem

Posted on 2003-10-21
5
Medium Priority
?
1,005 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 2

Expert Comment

by:Djinn_ro
ID: 9593926
Use vbCrLf
0
 
LVL 7

Accepted Solution

by:
Z_Beeblebrox earned 500 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

722 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