|
-
Feb 3rd, 2004, 04:32 PM
#1
Thread Starter
Lively Member
New Line in strings
I'm reading text out of a text file and I want to put it into a ToolTip control with multiple lines. I have control over the text file, so I can format it anyway I want. The text file would look something like this:
Code:
line 1 vbcrlf line 2
I want to read it in a line at a time and assign it to the tooltip. Something like:
VB Code:
Dim str as String = sr.Readline
ToolTip1.SetToolTip(TextBox1, str)
Then when the cursor is on TextBox1, I want it to show
rather than what it looks like in the textfile. I guess I need some kind of escape sequence, but I'm not sure how to do it.
-
Feb 4th, 2004, 03:26 AM
#2
This code gives you a tooltip split over two lines.
What are you having problems with? Are you not able to replace the CR/LF character from your text file with a vbCrLf?
VB Code:
ToolTip1.SetToolTip(TextBox1, "first" & vbCrLf & "second")
This world is not my home. I'm just passing through.
-
Feb 5th, 2004, 09:41 AM
#3
Thread Starter
Lively Member
I know I could split it up and do what you said, but I was hoping for something easier.
I once heard that the best programmers are lazy. If so, I'm the best damn programmer in the world.
-
Feb 5th, 2004, 02:53 PM
#4
Member
Think I understand you....
If so you want to do this after reading the line from the file and before assigning it to the tooltip...
VB Code:
str = str.Replace("vbcrlf", vbCrLf)
-
Jun 28th, 2006, 06:14 AM
#5
Addicted Member
Re: New Line in strings
 Originally Posted by McBain2
Think I understand you....
If so you want to do this after reading the line from the file and before assigning it to the tooltip...
VB Code:
str = str.Replace("vbcrlf", vbCrLf)
Hey! The vbCrLf thing does not work..or am i missing something?
Home is where your Head is
-
Jun 28th, 2006, 06:27 AM
#6
Re: New Line in strings
Use Environment.NewLine instead of VBCrLf
Edit--
wossname
Last edited by Shuja Ali; Jun 28th, 2006 at 06:44 AM.
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jun 28th, 2006, 06:27 AM
#7
Re: New Line in strings
Use Environment.Newline instead of vbCRLF.
I don't live here any more.
-
Jun 28th, 2006, 06:37 AM
#8
Addicted Member
Re: New Line in strings
 Originally Posted by wossname
Use Environment.Newline instead of vbCRLF.
yes i figured that out
thank you
Home is where your Head is
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|