Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
725
New line on UltraTextEditro
posted

Hello,

I have a very simple problem. I want to load to a multiline ultratexteditor 2 lines. My code is something like that:

ultratexteditro1.Text = @"USE [master]"+"\n";

ultratexteditr1.Text += @"CREATE DATABASE dbname"+"\n";

But when I load the form, the editor shows only 1 line regardless of my escape characters.

What am I doing wrong?

Parents
  • 2077
    Verified Answer
    Offline posted

    Struski said:

    But when I load the form, the editor shows only 1 line regardless of my escape characters.

    In Windows the new line escape characters are CR+LF (\r\n), not just LF. So you should use Environment.NewLine in your code:

    Struski said:

    ultratexteditro1.Text = @"USE [master]"+ Environment.NewLine;

    ultratexteditr1.Text += @"CREATE DATABASE dbname"+Environment.NewLine;

     HTH,

    Emanuel

Reply Children
No Data