以textbox为例

        ①:先设置textbox的属性Multiline为true

        ②:组织好显示字符串:FistLine(第一行要显示的字符)、SecondLine(第二行要显示的字符)、。。。。。。。、第n行字符

        ③:textbox.text="FistLine"+System.Environment.NewLine+"SecondLine"+System.Environment.NewLine+。。。。+"第N 行"+System.Environment.NewLine

   当你看到上面代码的时候可能会认为我们一般用的换行符不是"\r\n"吗

  你会想到这种方式:textbox.text="FistLine"+“\r\n”+"SecondLine"+"\r\n"+。。。。+"第N 行"+"\r\n"

 这种格式可能在运行时也不会出错,但在Linux操作系统或其他系统可能就会出错

相关文章:

  • 2022-01-25
  • 2022-12-23
  • 2022-12-23
  • 2021-06-11
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
  • 2021-09-26
  • 2022-12-23
  • 2022-02-26
相关资源
相似解决方案