开发者

New line or Carraige Return syntax problems

开发者 https://www.devze.com 2023-01-03 10:24 出处:网络
Im pretty new to coding, heres my problem. Results->Text = \"G55 > Y\" + System::Convert::ToString(destY);

Im pretty new to coding, heres my problem.

Results->Text = "G55 > Y" + System::Convert::ToString(destY);

"Results" is a System.Windows.Forms.Textbox "multiline btw", or so says VS.

That line works fine, but i need a "new line or CR" at the end, so that i can repeat that line with differe开发者_Go百科nt Literals and a different var in ToString.

For days now ive tried different syntax's ive read about, and i cant get it to take any of them.

Or even a complete different way to input text into Results->Text that would allow for tidy multiline use.

Sidenote: since im using ->Text and System::Convert::ToString in VC, would this code be considered just c++ or .net or CLI? to tighten my searches.


Have you tried System::Environment::NewLine? This will give you CrLf on Windows and whatever is correct for Linux/OS X on those platforms.


Being completely unfamiliar with .NET, I could be completely wrong, but surely adding a + "\n" to the end of your line would do the job? Or failing that, a + "\r\n"?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号