473,396 Members | 1,666 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Insert a newline into a string

36
I am using a tooltip control for a picturebox control. I would like to display the caption of the tooltip in newline. How to do this?
My picturebox name is help and tooltip name is ttp and I am displaying this tooltip on the mousehover event of the pictureimage.

Expand|Select|Wrap|Line Numbers
  1. Private Sub help_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles help.MouseHover
  2.     tt1.SetToolTip(help, "You can select one of the two setup dialog box.The Setup type dialog boxes views are represented below \r\n Based on the selection of this setup type, The installscript project displays corresponding setup type type during the installation of your application")
  3. End Sub
I am using \r\n to insert a newline. But it doesn't work. Can you help me?
Dec 31 '07 #1
6 4245
VijaySofist
107 100+
I am using a tooltip control ...
Hi!

You can use vbNewLine command.

Your code can be changed as follows

Expand|Select|Wrap|Line Numbers
  1. Private Sub help_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles help.MouseHover
  2.     tt1.SetToolTip(help, "You can select one of the two setup dialog box.The Setup type dialog boxes views are represented below" & vbNewLine & " Based on the selection of this setup type, The installscript project displays corresponding setup type type during the installation of your application")
  3. End Sub
All the best.

With Regards
Vijay. R
Dec 31 '07 #2
debasisdas
8,127 Expert 4TB
You can also use chr(10) , chr(13) or combination of both for the purpose.
Dec 31 '07 #3
CyberSoftHari
487 Expert 256MB
One more point, You can use
Expand|Select|Wrap|Line Numbers
  1. vbCr
Dec 31 '07 #4
Killer42
8,435 Expert 8TB
One thing to keep in mind. Based on other posts here, I believe that in VB6, ToolTipText cannot include line breaks. Um... as far as I can recall, they are simply ignored. It may be that this is still the case in your version.

Or they may have improved matters, of course - don't give up too easily. :)
Jan 1 '08 #5
QVeen72
1,445 Expert 1GB
Hi,

Yes Killer, VB.net has Improved, and ToolTip Control can have new Lines..

Add a ToolTip Control to your form, and ..


Me.ToolTipProviderCtl.SetToolTip(Me.Button1, "this is" _
& environment.NewLine & _
"a multiline" & environment.NewLine & "tooltip!")


REgards
Veena
Jan 1 '08 #6
Killer42
8,435 Expert 8TB
Thanks for that, Veena.

It's good to know MS did fix some of the annoying bits. :)
Jan 1 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

20
by: akej via SQLMonster.com | last post by:
Hi, i have table with 15 columns CREATE TABLE . ( PRIMARY KEY , NULL , NULL , NULL , NULL , (50) NULL , NULL
5
by: Vamsi | last post by:
Hi, I am trying a basic opearation of splitting a multiline value to an array of single lines(Actually making Address into AddressLine1, AddressLine2). I used Environment.NewLine in split, I...
7
by: deko | last post by:
In VB, I would do this for a new line: str = "text here" & VbCrLf & "more text" For other characters, I would use the ascii code: For example, Chr(34) is a double quote ("). how do I do...
4
by: Peter Kirk | last post by:
Hi I would like to ask a little bit about the value Environment.Newline: what is it and what is the point of it? Ok, I can see in the docs that it represents "newline" for the current platform -...
9
by: anachronic_individual | last post by:
Hi all, Is there a standard library function to insert an array of characters at a particular point in a text stream without overwriting the existing content, such that the following data in...
16
by: junky_fellow | last post by:
Is there any efficcient way of removing the newline character from the buffer read by fgets() ? Is there any library function that is similar to fgets() but also tells how many bytes it read...
11
by: rossum | last post by:
I want to declare a const multi-line string inside a method, and I am having some problems using Environment.NewLine. I started out with: class foo { public void PrintStuff() { const...
7
by: Francesco Pietra | last post by:
How to insert letter "A" on each line (of a very long list of lines) at position 22, i.e., one space after "LEU", leaving all other characters at the same position as in the original example: ...
5
by: alex21 | last post by:
I am trying to write a function for determining the data type of columns in a delimited file. However my function is not detecting a newline and exiting the loop after the end of the first line. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.