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

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?
 
A

Andrew Morton

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
 
E

Egghead

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
 
C

Computer Guru

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.
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

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.
 
C

Chris Dunaway

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top