Cannot get chr(10) or chr(13) to show

  • Thread starter Thread starter Computer Guru
  • Start date Start date
C

Computer Guru

I have a form I'm using as a dialog box.
It has default text that is two paragraphs.

It has a function setText(byval text as string)
that specifies the text in the read-only textbox that's on it.

For some odd reason,

dialog1.setText("Line 1" & chr(13) & chr(13) & "Line 2") shows up as
"Line 1Line 2" on Vista, and as "Line 1[]Line2" on 2k3, where [] is an
unprintable character.

The original text (default) shows up just fine.

using chrw() instead of chr() or 10 instead of 13 makes no difference.

Using + instead of & doesn't make a difference either.

Do you have any idea what is causing the enter characters to not show?
multiline is set to true.

chr(9) for tab works just fine, as do other characters.

Anyone see this before?
 
Computer said:
I have a form I'm using as a dialog box.
It has default text that is two paragraphs.

It has a function setText(byval text as string)
that specifies the text in the read-only textbox that's on it.

For some odd reason,

dialog1.setText("Line 1" & chr(13) & chr(13) & "Line 2") shows up as
"Line 1Line 2" on Vista, and as "Line 1[]Line2" on 2k3, where [] is an
unprintable character.

The original text (default) shows up just fine.

using chrw() instead of chr() or 10 instead of 13 makes no difference.

Using + instead of & doesn't make a difference either.

Do you have any idea what is causing the enter characters to not show?
multiline is set to true.

You want vbCrLF, which is the same as Chr(13) & Chr(10), which is the line
end Windows expects.

Andrew
 
May be this one is better " System.Environment.NewLine()"
--
cheers,
RL
Andrew Morton said:
Computer said:
I have a form I'm using as a dialog box.
It has default text that is two paragraphs.

It has a function setText(byval text as string)
that specifies the text in the read-only textbox that's on it.

For some odd reason,

dialog1.setText("Line 1" & chr(13) & chr(13) & "Line 2") shows up as
"Line 1Line 2" on Vista, and as "Line 1[]Line2" on 2k3, where [] is an
unprintable character.

The original text (default) shows up just fine.

using chrw() instead of chr() or 10 instead of 13 makes no difference.

Using + instead of & doesn't make a difference either.

Do you have any idea what is causing the enter characters to not show?
multiline is set to true.

You want vbCrLF, which is the same as Chr(13) & Chr(10), which is the line
end Windows expects.

Andrew
 
Andrew said:
You want vbCrLF, which is the same as Chr(13) & Chr(10), which is the line
end Windows expects.

Andrew

Well, I tried chr(13) & chr(10) together, but that didn't work.

I've always used chr(13) or chr(10) by itself.......

Trying the other suggestion now though.
 
Computer said:
I've always used chr(13) or chr(10) by itself.......

Then you have just been lucky to only use it with methods that accept
different kinds of newline combinations.
 
I have a form I'm using as a dialog box.
It has default text that is two paragraphs.

It has a function setText(byval text as string)
that specifies the text in the read-only textbox that's on it.

For some odd reason,

dialog1.setText("Line 1" & chr(13) & chr(13) & "Line 2") shows up as
"Line 1Line 2" on Vista, and as "Line 1[]Line2" on 2k3, where [] is an
unprintable character.

The original text (default) shows up just fine.

using chrw() instead of chr() or 10 instead of 13 makes no difference.

Using + instead of & doesn't make a difference either.

Do you have any idea what is causing the enter characters to not show?
multiline is set to true.

chr(9) for tab works just fine, as do other characters.

Anyone see this before?

What does SetText do? Does it set the text of the read only text
box? Is the TextBox.Multiline property set to true?

Chris
 
Back
Top