This is a TuT on how to use ControlChars.CrLf. Credits to my Reference book.
Occasionally we need to break up the MessageBox or other text messages into multiple lines. Visual Basic provides many classes with a few constants that can be used to accomplish this task. Let's take a look at some of the constants and apply them.
The ControlChars module has many constants that can be used in order to control the output. Once you use it, a new instasnce of Microsoft.VisualBasic.ControlChars will be initialized. Here are some of the members of this class:
ControlChars.CrLf: Carriage Control and Linefeed
ControlChars.Cr: Carrage return
ControlChars.Lf: Linefeed
ControlChars.NewLine: New line
ControlChars.Back Backspace
Here's an example of using these ! Note: I am improvising here, as the original sample code was written in VB6! Please correct me if i do something wrong.
[PHP]MsgBox("You have unsaved data" & Microsoft.VisualBasic.ControlChars.Back & "Quit Now?", _
"Save Data", MsgBoxStyle.YesNo, _
MsgBoxIcon, Information)[/PHP]
I will be writing up a more detailed tutorial on ControlChars in using it in a more complex manner. Please press Thanks if you found this useful!
Thanks for sharing
Lol thanks guys !
You don't even use ControlChars.CrLf in the sample code. You use ControlChars.Back
Assembly Programmer
Doesn't matter, you should understand the concept anyway.
Edit: Yay 900 posts!
Thanks Mnpeepno!
Good for learning!
I would really appreciate it if everyone gathered all their tuts and sent them to me in VM
This one can really be in Snippets Water - Ill add it to snippets soon
Alright Thanks NextGen! And i'll be doing a more detailed Tutorial about this soon =D
Well Done, Nice tutorial, Very detailed.
I'm back.
Thanks for sharing =P
Welcome all =D. Glad everyone liked it :P