Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"\r\n" displays two black blocks?

Status
Not open for further replies.

theweirdo

Programmer
Aug 7, 2002
17
CA
I'm doing something like this in a windows control method:

return text.Insert(4, Environment.NewLine);

but then when I display text in my control, I see something like: asdf||asdf, where the "||" are some sort of thick black blocks.

Anyone know the reason why? Same thing happens if I use \r\n.

Thanks.
 
Set the Multiline property to true and you will see the \r\n are there but the text is on many lines.
-obislavu-
 
The control that I'm using, TreeView, does not seem to have a Multiline property. What should I do?

Thanks.
 
If the control doesn't support multi-line text, and displays bad characters when you try to use carriage-return line-feeds, then you need to do one of:
1) Rearrange your form to give the TreeView more room so that you don't have to wrap the text.
2) Find another tree control that does what you want.
3) Write your own tree control that does what you want.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
What is the reason to insert \r\n in that text ?
If you do that in order to be diplayed on many lines then you should tell the control that shows the text to accept multilines.
In the case of of the TreeView , derive myTreeNode : TreeNode and store here the multiline text associated to a node.
The short text for the node will be displayed always and the multiline text could be displayed using a tooltip object (System.Windows.Forms.ToolTip) when the mouse is over a node.
-obislavu-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top