J
JC
I can't get \n to work in a multiline textbox, what do I need to do? If I
need to add a hard return then what is that sequence.
jc
need to add a hard return then what is that sequence.
jc
JC said:I can't get \n to work in a multiline textbox, what do I need to do? If I
need to add a hard return then what is that sequence.
JC said:I can't get \n to work in a multiline textbox, what do I need to do? If I
need to add a hard return then what is that sequence.
C# Learner said:Environment.NewLine will return the newline specifier for whichever
platform your app is running on.
So:
textBox.AppendText("foo" + Environment.NetLine + "bar");
Jon said:Note, however, that "the newline specifier for the platform" won't
*necessarily* be the newline specifier required to get a text box to
use new lines.
[...]
C# Learner said:Would you recommend using "\r\n" instead, then, for effecting a new line
in a ".NET" text box?
I've been using Environment.NewLine as I'd expect, for example, that
Mono text boxes use *nix new line specifiers. Does anyone know if this
is the case?
Jon said:I suspect it may well depend on what kind of textbox you're using. If
you're using the WINE, S.W.F.TextBox could well still need \r\n, but
the GTK# bindings may use \n. It's a bit of a mess, really![]()
Jon said:Note, however, that "the newline specifier for the platform" won't
*necessarily* be the newline specifier required to get a text box to
use new lines. It's more (IMO) for the default newline in text files.
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.