Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1006
  • Last Modified:

vbNewLine Problem

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
myname17
Asked:
myname17
1 Solution
 
Djinn_roCommented:
Use vbCrLf
0
 
Z_BeeblebroxCommented:
You need to make the text box a multiline text box, it is one of the properties.

Zaphod.
0
 
cool12399Commented:
also, make sure you enable the scrollable property (vertical scrollbars).
0
 
cool12399Commented:
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
 
eric0213Commented:
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now